BookmarkSubscribeRSS Feed
Sivanandam
Calcite | Level 5
Hi ,

When i run the below code am getting the following error message
ERROR 200-322: The symbol is not recognized and will be ignored.

ERROR 22-322: Expecting a name.


Code:
filename xx'xo94.control.userview' disp=shr;
filename yy'xo94.control.user' disp=old;
data siva;
input id $;
cards;
srgm2010
srgm2001
;
proc pdscopy indd=xx outdd=yy;
select "id @1";
run;

Could you please help me to resolve this..
7 REPLIES 7
SushilNayak
Obsidian | Level 7
You don't need to quote the member name. Remove the quotes around the member name id@1 and resubmit the code. It should work

proc pdscopy indd=xx outdd=yy;
select id @1;
run;
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
The OP is wishing to generate the SELECT statement dynamically using a SAS file which is not properly supported.

One alternative is to read up the member list, generate a SAS macro variable and then reference that variable as the SELECT statement data value.

Scott Barry
SBBWorks, Inc.
Sivanandam
Calcite | Level 5
Scott,
I tried with the follwoing code with MACRO its working fine

%let id=SRGM2001 SRGM20002;

filename xx'xo94.control.userview' disp=shr;
filename yy'xo94.control.user' disp=old;
data siva;
proc pdscopy indd=xx outdd=yy;
select &id;
run;

is it possible to pass the input members via the file.
Sivanandam
Calcite | Level 5
Sushi,

It will not work because select statement will consider ID as a member and it will search in the PDS.

Thanks,
Siva.
SushilNayak
Obsidian | Level 7
I'm really sorry..i misunderstood your question...i thought u were selecting member ID@1 instead of ID & @1 ..my bad..Anyhow it seems you fixed the issue...for the getting members name within the macro variable. use PROS SQL

filename xx'xo94.control.userview' disp=shr;
filename yy'xo94.control.user' disp=old;

data siva;
input id $;
cards;
srgm2010
srgm2001
;
run;

proc sql;
select id into : memlist separated by ' '
from siva;
quit;

proc pdscopy indd=xx outdd=yy;
select &memlist;
run;
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Yes you can.

To pass the selection criteria via a file, you would need to use %INCLUDE to reference an input file and code the statement between a SELECT statement and a trailing statement with a semi-colon, as in:

FILENAME input "_your_input_selection_list" ;
PROC PDSCOPY ....;
SELECT
%INCLUDE input;
;
run;

Scott Barry
SBBWorks, Inc.
Sivanandam
Calcite | Level 5
Thanks for all.
Both the mentod are working fine.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 7 replies
  • 2127 views
  • 0 likes
  • 3 in conversation