- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello all,
I use SAS 9.4 PC version,
I have to add extra space between rows of dataline(cards), otherwise will miss half data. please help.
I don't know why my post will add extra space automatically,if you copy my code there will be spaces betwween rows of data. my code don't has extra space.
data layout;
input a $1-500 ;
cards;
@1 CLASS $40.
@45 ID $10.
@61 Gailer $100.
@161 Mid $20.
@181 PERMIT $8.
@189 DEST $8.
@197 Rur $8.
@205 Month $8.
@223 Mac $40.
@263 Product $40.
@303 Weight_Range $8.
@326 Revenue 8.
@338 Pieces 8.
@350 Weight 8.
@365 MC_Doc $10.
@382 CP_Doc $10.
;
run;
data layout2;
input a $1-500 ;
cards;
@1 CLASS $40.
@45 ID $10.
@61 Gailer $100.
@161 Mid $20.
@181 PERMIT $8.
@189 DEST $8.
@197 Rur $8.
@205 Month $8.
@223 Mac $40.
@263 Product $40.
@303 Weight_Range $8.
@326 Revenue 8.
@338 Pieces 8.
@350 Weight 8.
@365 MC_Doc $10.
@382 CP_Doc $10.
;
run;
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
First.
This process looks strange to me. The reading of input criteria as card statements.
I wont judge as maybe you are using that as a mock up.
but try this...
data layout;
infile cards missover;
input a $1-500 ;
cards;
/** your card stuff **/
;
run;
hth
zeke torres
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@zekeT_sasaholic: missover won't work, as a is then set to missing on all observations.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Kurt.
thanks - you are correct.
i did copy/cut/paste his code over and felt the infile would do the trick.
i tried before/after.
i got lazy on doing a proc print to test (although i did look at the log).
hence the half ass-ed success.
mea culpa.
fwiw - i have opted to not make any suggestions without the appropriate amount of coffee to complexity ratio.
best
z
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Add
infile cards truncover;
before the input statement. Your explicit definition of $1-500 forces SAS to look for more characters than are present on the dataline, and so it skips to the next line. This is NOTEd in the log.
The truncover option just tells SAS to be OK with what's there on the input line, and not skip.