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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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