SAS 通过逻辑库引用名实现相关联

SAS逻辑库是可以有多个物理位置的


下面的代码示例给出了下定义多个物理位置的SAS逻辑库Y2014。

这3段代码都能实现将逻辑库引用名:Y2014与4个物理位置:

e:\sas\data\Quater1

e:\sas\data\Quater2

e:\sas\data\Quater3

e:\sas\data\Quater4

相关联。

代码1:

LIBNAME Y2014('e:\sas\data\Quater1'  'e:\sas\data\Quater2'  'e:\sas\data\Quater3'  'e:\sas\data\Quater4');

注意:使用空格进行分隔

代码2:

LIBNAME Q1  'e:\sas\data\Quater1'

LIBNAME Q2  'e:\sas\data\Quater2'

LIBNAME Q3  'e:\sas\data\Quater3'

LIBNAME Q4  'e:\sas\data\Quater4'

LIBNAME Y2014 (Q1 Q2 Q3 Q4);

代码3:

LIBNAME Q2  'e:\sas\data\Quater2'

LIBNAME Q3  'e:\sas\data\Quater3'

LIBNAME Q4  'e:\sas\data\Quater4'

LIBNAME Y2014 ('e:\sas\data\Quater1' Q2 Q3 Q4);

当一个物理位置下的空间不够时,定义多个物理位置的SAS逻辑库非常有用。

这样,在写程序时只需要用一个SAS逻辑库引用名,当前面的物理路径空间用尽时,SAS会自动将定义的SAS文件存储到其他物理路径。 

猜你喜欢

转载自www.cnblogs.com/wdkshy/p/9776071.html
SAS