全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
12089 7
2008-05-30

   Recreating a SAS Data Set from a Compressed SAS Transport File
For SAS transport file created by PROC CPORT, follow these steps to recreate the SAS dataset:


Begin by uncompressing the downloaded file. Use unzip if you are unzipping the file on an Unix machine or use WinZip/pkzip if you are unzipping the file on a PC. You will then have the SAS Transport file created using PROC CPORT.

The program listed below will recreate the SAS data set from the Transport file. WARNING: All of the SCF data sets are rather large, make sure you have enough space to recreate the data set before running the program.
LIBNAME OUT 'output SAS library';
FILENAME IN 'input transport file name';

PROC CIMPORT DATA=OUT.dataset INFILE=IN;
RUN;

For SAS transport file created by PROC COPY with an XPORT option, follow these steps to recreate the SAS dataset:

Begin by uncompressing the downloaded file. Use unzip if you are unzipping the file on an Unix machine or use WinZip/pkzip if you are unzipping the file on a PC. You will then have the SAS Transport file created using PROC COPY with an XPORT option.

The program listed below will recreate the SAS data set from the Transport file. WARNING: All of the SCF data sets are rather large, make sure you have enough space to recreate the data set before running the program.
LIBNAME NEW 'output SAS library';
LIBNAME TRANS XPORT 'input transport file name';


PROC COPY IN=TRANS OUT=NEW;
RUN;


ENDSAS;


我有个数据文件,用sas不能直接打开,说是要用上述方法导入,但我不太明白具体步骤和顺序。请大家帮助,谢谢!

[此贴子已经被作者于2008-5-31 11:10:54编辑过]

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2008-5-30 18:30:00

LIBNAME OUT 'output SAS library';
FILENAME IN 'input transport file name';

PROC CIMPORT DATA=OUT.dataset INFILE=IN;
RUN;

LIBNAME NEW 'output SAS library';
LIBNAME TRANS XPORT 'input transport file name';


PROC COPY IN=TRANS OUT=NEW;
RUN;
这两个是一起用,顺序是怎样的。
请大家帮助,谢谢!

[此贴子已经被作者于2008-5-31 11:12:24编辑过]

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2008-5-30 18:40:00

请帮助看看!谢谢!

[此贴子已经被作者于2008-5-31 11:12:50编辑过]

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2008-5-31 00:01:00

Your variable "AGECL" should be class variable instead of analysis variable.

Based on your data, i tried this:

data empiricalnew;
 input INCOME NETWORTH AGECL;
 cards;
1304132.14 5529000 3
1304132.14 6379000 3
1304132.14 6520000 3
1304132.14 6480000 3
1304132.14 5520000 3
308062.71 4118600 3
308062.71 4118600 3
308062.71 4118600 3
308062.71 4118600 3
308062.71 4118600 3
4097234.04 59433660 4
4035621.5 59434080 4
4035621.5 59434200 4
4066427.77 59433380 4
3789171.33 59433980 4
;
run;


   proc means data=empiricalnew noprint;
        by AGECL;
        var income NETWORTH  ;
        output out=final(drop=_type_ _freq_) mean=IncomeMean NETWORTHmean ;
   run;
   data thesis.finalnew;
       set thesis.final;
    if AGECL= 1 then age1=1;else age1=0;
       if AGECL= 2 then age2=1;else age2=0;
    if AGECL= 3 then age3=1;else age3=0;
    if AGECL= 4 then age4=1;else age4=0;
    if AGECL= 5 then age5=1;else age5=0;
    if AGECL= 6 then age6=1;else age6=0;
   run;    

[此贴子已经被作者于2008-6-1 11:37:51编辑过]

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2008-6-1 01:06:00
What is LZ's question?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2008-6-2 03:10:00
2008-6-1 1:16:00jjpanda1111给您发送的消息! 消息标题:problem
不知道怎样通过这两个过程将一个sas压缩数据文件读入sas
To uncompress a SAS dataset, just use option compress=no in data step. Please see http://www.ciser.cornell.edu/FAQ/SAS/new_compress.shtml and http://www.sfu.ca/sasdoc/sashtml/lgref/z1288760.htm.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群