BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
DavidFord
Calcite | Level 5

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.

1 ACCEPTED SOLUTION

Accepted Solutions
novinosrin
Tourmaline | Level 20

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 

View solution in original post

2 REPLIES 2
novinosrin
Tourmaline | Level 20

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 

DavidFord
Calcite | Level 5

Thank you.  Not sure how long that would have taken me to figure out on my own.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1351 views
  • 0 likes
  • 2 in conversation