Help using Base SAS procedures

Help needed in PROC PDSCOPY

Reply
Contributor
Posts: 38

Help needed in PROC PDSCOPY

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..
Contributor
Posts: 31

Re: Help needed in PROC PDSCOPY

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;
Super Contributor
Super Contributor
Posts: 3,174

Re: Help needed in PROC PDSCOPY

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.
Contributor
Posts: 38

Re: Help needed in PROC PDSCOPY

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.
Contributor
Posts: 38

Re: Help needed in PROC PDSCOPY

Sushi,

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

Thanks,
Siva.
Contributor
Posts: 31

Re: Help needed in PROC PDSCOPY

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;
Super Contributor
Super Contributor
Posts: 3,174

Re: Help needed in PROC PDSCOPY

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.
Contributor
Posts: 38

Re: Help needed in PROC PDSCOPY

Thanks for all.
Both the mentod are working fine.
Ask a Question
Discussion stats
  • 7 replies
  • 444 views
  • 0 likes
  • 3 in conversation