楼主: jjpanda1111
12378 7

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

  • 5关注
  • 0粉丝

已卖:4285份资源

教授

36%

还不是VIP/贵宾

-

威望
0 级
论坛币
7798 个
通用积分
139.3299
学术水平
39 点
热心指数
43 点
信用等级
38 点
经验
23898 点
帖子
763
精华
0
在线时间
1627 小时
注册时间
2006-8-4
最后登录
2026-11-9

楼主
jjpanda1111 发表于 2008-5-30 18:26:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
<p>&nbsp;&nbsp; Recreating a SAS Data Set from a Compressed SAS Transport File<br/>For SAS transport file created by PROC CPORT, follow these steps to recreate the SAS dataset:</p><p><br/>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. </p><p>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.<br/>LIBNAME OUT 'output SAS library';<br/>FILENAME IN 'input transport file name';</p><p>PROC CIMPORT DATA=OUT.dataset INFILE=IN;<br/>RUN; </p><p>For SAS transport file created by PROC COPY with an XPORT option, follow these steps to recreate the SAS dataset:</p><p>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. </p><p>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.<br/>LIBNAME NEW 'output SAS library';<br/>LIBNAME TRANS XPORT 'input transport file name';</p><p><br/>PROC COPY IN=TRANS OUT=NEW;<br/>RUN; </p><p><br/>ENDSAS;</p><p><br/>我有个数据文件,用sas不能直接打开,说是要用上述方法导入,但我不太明白具体步骤和顺序。请大家帮助,谢谢!</p>

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

二维码

扫码加我 拉你入群

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

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

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

沙发
jjpanda1111 发表于 2008-5-30 18:30:00
<p>LIBNAME OUT 'output SAS library';<br/>FILENAME IN 'input transport file name';</p><p>PROC CIMPORT DATA=OUT.dataset INFILE=IN;<br/>RUN; </p><p>LIBNAME NEW 'output SAS library';<br/>LIBNAME TRANS XPORT 'input transport file name';</p><p><br/>PROC COPY IN=TRANS OUT=NEW;<br/>RUN; <br/>这两个是一起用,顺序是怎样的。<br/>请大家帮助,谢谢!</p>

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

藤椅
jjpanda1111 发表于 2008-5-30 18:40:00
<p><font size="3">请帮助看看!谢谢!</font></p>

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

板凳
olover 发表于 2008-5-31 00:01:00
<p>Your variable "AGECL" should be class variable instead of analysis variable.</p><p>Based on your data, i tried this:</p><p>data empiricalnew;<br/>&nbsp;input INCOME NETWORTH AGECL;<br/>&nbsp;cards;<br/>1304132.14 5529000 3 <br/>1304132.14 6379000 3 <br/>1304132.14 6520000 3 <br/>1304132.14 6480000 3 <br/>1304132.14 5520000 3 <br/>308062.71 4118600 3 <br/>308062.71 4118600 3 <br/>308062.71 4118600 3 <br/>308062.71 4118600 3 <br/>308062.71 4118600 3 <br/>4097234.04 59433660 4 <br/>4035621.5 59434080 4 <br/>4035621.5 59434200 4 <br/>4066427.77 59433380 4 <br/>3789171.33 59433980 4 <br/>;<br/>run;</p><p><br/>&nbsp;&nbsp; proc means data=empiricalnew noprint;<br/>&nbsp;&nbsp;&nbsp;&nbsp;<font size="5">&nbsp;&nbsp;&nbsp; </font><font face="黑体"><font size="5">by AGECL;</font><br/></font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var income NETWORTH&nbsp; ;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; output out=final(drop=_type_ _freq_) mean=IncomeMean NETWORTHmean ;<br/>&nbsp;&nbsp; run; <br/>&nbsp;&nbsp; data thesis.finalnew;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set thesis.final;<br/>&nbsp;&nbsp;&nbsp; if AGECL= 1 then age1=1;else age1=0;<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if AGECL= 2 then age2=1;else age2=0;<br/>&nbsp;&nbsp;&nbsp; if AGECL= 3 then age3=1;else age3=0;<br/>&nbsp;&nbsp;&nbsp; if AGECL= 4 then age4=1;else age4=0;<br/>&nbsp;&nbsp;&nbsp; if AGECL= 5 then age5=1;else age5=0;<br/>&nbsp;&nbsp;&nbsp; if AGECL= 6 then age6=1;else age6=0; <br/>&nbsp;&nbsp; run;&nbsp;&nbsp;&nbsp;&nbsp; </p><p></p>

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

报纸
PharmD 发表于 2008-6-1 01:06:00
What is LZ's question?<br/>

地板
PharmD 发表于 2008-6-2 03:10:00
<div class="quote">在<b>2008-6-1 1:16:00</b>,<b>jjpanda1111</b>给您发送的消息!


<b>消息标题:problem</b><hr size="1"/>不知道怎样通过这两个过程将一个sas压缩数据文件读入sas<br/>
</div>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.<br/>

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) - <br/>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最后怎么导进去的啊,这个文件就没有后缀名是怎么回事

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

客服
GMT+8, 2026-11-27 17:05