楼主: jjpanda1111
11597 7

[求助]不太明白PROC CPORT和PROC COPY 的使用 [推广有奖]

  • 5关注
  • 0粉丝

教授

24%

还不是VIP/贵宾

-

威望
0
论坛币
9100 个
通用积分
173.2330
学术水平
38 点
热心指数
42 点
信用等级
37 点
经验
23751 点
帖子
733
精华
0
在线时间
1492 小时
注册时间
2006-8-4
最后登录
2024-4-4

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

   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编辑过]

二维码

扫码加我 拉你入群

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

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

关键词:CPORT COPY Port ROC downloaded proc COPY CPORT

沙发
jjpanda1111 发表于 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编辑过]

使用道具

藤椅
jjpanda1111 发表于 2008-5-30 18:40:00 |只看作者 |坛友微信交流群

请帮助看看!谢谢!

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

使用道具

板凳
olover 发表于 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编辑过]

使用道具

报纸
PharmD 发表于 2008-6-1 01:06:00 |只看作者 |坛友微信交流群
What is LZ's question?

使用道具

地板
PharmD 发表于 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.

使用道具

7
PharmD 发表于 2008-6-2 03:12:00 |只看作者 |坛友微信交流群
In addition, the reference provides the following information (http://www.ats.ucla.edu/stat/sas/library/nesug00/ad1007.pdf) -
As mentioned earlier, each time the SAS System reads (e.g., applies a Procedure or another Data Step) to a compressed data set, the data set must be uncompressed. Users have no control over whether or not the data set is uncompressed; the SAS System does this automatically. Additional CPU resources are required to uncompress the data set before it can be used again by the SAS System.

使用道具

8
rreewwq 发表于 2015-10-9 00:22:29 |只看作者 |坛友微信交流群
lz最后怎么导进去的啊,这个文件就没有后缀名是怎么回事

使用道具

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-20 01:53