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 secondsAny 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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.