开发者

Extra and misaligned rows when importing data in SAS

开发者 https://www.devze.com 2023-04-09 09:18 出处:网络
I am trying to import data in SAS like: ABCDE xyzhi s1s2s3s4s5 where A B C D and E are column names. I have 240 columns in my dataset and the code I am using is:

I am trying to import data in SAS like:

A   B    C    D    E
x   y    z    h    i
s1  s2   s3   s4   s5

where A B C D and E are column names.

I have 240 columns in my dataset and the code I am using is:

data INFO;
infile Attdata notab dlm='09'x dsd missover LRECL = 100000000;
length A B C D E $200; (I am importing 240 columns)
input A B C D E;
run;

Whenever I import data, some of the rows of column B, C etc, gets stacked below rows of A:

A   B    C    D    E
x             h    i
s1  s2  s3        s5
y   s4
z

Is there a way to fix this? Do I need to do something with lrecl one? My data gets all weird after running this code. Migh开发者_如何学JAVAt there be problem with length one?


It may be something to do with missover (rather than LRECL). I have found this site to be useful in the past: http://www2.sas.com/proceedings/sugi26/p009-26.pdf

Are you saying in your question that data from line 1 is appearing on lines 3 and 4 and some data from line 2 is on line 3? I've never seen SAS do this before.

You may want to check your delimiter/end of line characters.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号