Hello,
I've created this code to input multiple observations per line:
data friendlist;
input name $4. rank @@;
datalines;
JOHN 13 MARY 12 SUE 15 TOME 10;
run;
proc print data = friendlist; run;
I'm getting this error message, which is making no sense to me. It seems to be interpreting the data line as code.
454 data friendlist; 455 input name $4. rank @@; 456 datalines; NOTE: The data set WORK.FRIENDLIST has 0 observations and 2 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 457 JOHN 13 MARY 12 SUE 15 TOME 10; ---- 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 458 run; 459 proc print data = friendlist; run; NOTE: No observations in data set WORK.FRIENDLIST. NOTE: PROCEDURE PRINT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds
Any help appreciated. Thanks.
data friendlist;
input name : $4. rank @@;
datalines;
JOHN 13 MARY 12 SUE 15 TOME 10
run;
proc print data = friendlist; run;
NOTE: No semicolons on the same line of the dataline
data friendlist;
input name : $4. rank @@;
datalines;
JOHN 13 MARY 12 SUE 15 TOME 10
run;
proc print data = friendlist; run;
NOTE: No semicolons on the same line of the dataline
Thank you. Not sure how long that would have taken me to figure out on my own.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.