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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 7 replies
  • 1556 views
  • 0 likes
  • 3 in conversation