BookmarkSubscribeRSS Feed
Sivanandam
Calcite | Level 5

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.

1 REPLY 1
Sivanandam
Calcite | Level 5

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;                                               

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 1 reply
  • 1271 views
  • 0 likes
  • 1 in conversation