全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
3453 3
2012-10-16
我的原始数据一行包含很多个字符,可能上千,我用这个程序跑的时候,只能跑到部分短的数据,过长的行读不到,请问大侠如何处理?
data logout;
        infile 'F:\logout.txt' delimiter=',&}' missover;
        input #1 @'t1:' host :$20.
                #1 @'t2:' urs :$40.
                #1 @'t3:' id :$10.
                #1 @'t5:' time :$10.
                #1 @'clientid":"' client :$20.
                #1 @'cp50ct":' cp50ct :$20.
                #1 @'cp60ct":' cp60ct :$20.
                #1 @'cp50my":' cp50my :$20.
                #1 @'sellmy":' sellmy :$20.
                #1 @'ednm":' ednm :$20.
                #1 @'maxea":' maxea :$10.
                #1 @'maxes":' maxes :$10.
                #1 @'maxpet":' maxpet :$10.
                #1 @'hynm":' fcount :$10.
                #1 @'mxlv":' advlv :$10.;
run;
二维码

扫码加我 拉你入群

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

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

全部回复
2012-10-16 18:17:08
同样关注。期待高手现身解答。
二维码

扫码加我 拉你入群

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

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

2012-10-16 19:41:10
问题在于默认缓冲区太小了,你可以在infile语句后加入lrecl=32767,即

data logout;
        infile 'F:\logout.txt' delimiter=',&}' missover lrecl=32767;
        input #1 @'t1:' host :$20.

sas help中说到:”LRECL=logical-record-length
specifies the logical record length.
Default:Dependent on the file characteristics of your operating environment
Restriction:LRECL is not valid when you use the DATALINES file specification.
Interaction:Alternatively, you can specify a global logical record length by using the LRECL= System Option in SAS System Options: Reference.
Operating environment:Values for logical-record-length are dependent on the operating environment. For details, see the SAS documentation for your operating environment.
Tip:LRECL= specifies the physical line length of the file. LINESIZE= tells the INPUT statement how much of the line to read. “
二维码

扫码加我 拉你入群

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

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

2012-10-17 10:00:16
iRoss2007 发表于 2012-10-16 19:41
问题在于默认缓冲区太小了,你可以在infile语句后加入lrecl=32767,即

data logout;
多谢楼上,已解决
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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