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;                                               

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—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
  • 1 reply
  • 1332 views
  • 0 likes
  • 1 in conversation