我对SAS还很陌生,目前还在学习。我已经读到,我们可以同时使用DSD和DLM选项来处理infile语句。
但是,当使用具有多个分隔符的数据执行下面的操作时,会出现一个错误。
代码:
data test;
infile cards dlm='@' dsd;
input pid visit $ dose;
cards;
101,vis1"0.05
102,vis2,0.1错误:
NOTE: Invalid data for pid in line 254 1-8.
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8---
255 102,vis2,10mg
NOTE: Invalid data errors for file CARDS occurred outside the printed range.
NOTE: Increase available buffer lines with the INFILE n= option.
pid=. vist=05mg drug=102,vis2 _ERROR_=1 _N_=1
NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
NOTE: The data set WORK.MH1 has 1 observations and 3 variables.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
256 ;你能不能帮我理解一下这一点来建立我的知识?
发布于 2016-09-12 18:19:12
这里的问题是您的DLM是'@‘(意思是说字段分隔符是@字符),但是数据显示',’作为分隔符(逗号)。
因此,您的错误是SAS试图将所有hta ("102,vis2,10 As“)读入一个数字字段(pid)。您要么需要更改为dlm=',',要么需要不同的数据。
https://stackoverflow.com/questions/39456000
复制相似问题