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

Hello I am getting an error with this statement and I'm not sure what I am doing wrong:

 

proc print data=dmbi.test (OBS=300);
(keep="Time"n "Provider Name"n "Class Name"n);
run;

 

Error:

71 proc print data=dmbi.test (OBS=300);

72 (keep="Time"n "Provider Name"n "Class Name"n);

_

180 ERROR 180-322: Statement is not valid or it is used out of proper order.

73 run;

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
proc print data=dmbi.test (OBS=300 keep="Time"n "Provider Name"n "Class Name"n);
run;

You can only have one set of parenthesis which enclose ALL data set options.

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26
proc print data=dmbi.test (OBS=300 keep="Time"n "Provider Name"n "Class Name"n);
run;

You can only have one set of parenthesis which enclose ALL data set options.

--
Paige Miller
Kurt_Bremser
Super User
proc print data=dmbi.test (OBS=300); /* this semicolon ends the PROC PRINT statement */
(keep="Time"n "Provider Name"n "Class Name"n);
run;

All dataset options need to be in one pair of brackets:

proc print data=dmbi.test (
  OBS=300
  keep="Time"n "Provider Name"n "Class Name"n
);
run;

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 536 views
  • 2 likes
  • 3 in conversation