Help using Base SAS procedures

Replacing strings in pds member

Reply
Contributor
Posts: 38

Replacing strings in pds member

Hi,

I need to replace a string in the PDS member ,string which i need to change in  each pds member are present in the seperate PS.

Example;

PDS:'xo94,sas,'

member names are:

SRGM2001

SRGM2002

SRGM2003

PS file:

Below are the dat present int hePS file

Membername      String which want to replace  in member

SRGM2001       SRGM2005

SRGM2002       SRGM2006

SRGM2003      SRGM2007

I want to read the SRGM2001 from the PS file and need to search in the PDS file if found i want to open that member

and need to search 2005 if present i need to replace with 2001 similarly for remaining members .

Could you please help me to achieve this

Thanks,

Siva.

Contributor
Posts: 38

Replacing strings in pds member

Hi,

I didn't get any reply for my above  requirement for three days which helped me to found the solution by my own.

Filevar statement and TRANWRD statement satisifed my requirement.

Please find the code as below

filename yy'xo94.store';                           

filename xx'xo94.sas.modelid';                     

data ss;                                           

infile xx;                                         

input store $;                                     

length ftrw $50;                                   

ftrw ='xo94.control.parm('||trim(store)||')';      

infile dummy filevar=ftrw sharebuffers end=done;   

FILE DUMMY FILEVAR=FTRW;                           

do until(done);                                    

input @1 sss  $80.;                               

%INCLUDE YY;  //Which contains TRANWRD stements                                     

put sss;                                         

end;                                               

run;                                               

Ask a Question
Discussion stats
  • 1 reply
  • 197 views
  • 0 likes
  • 1 in conversation