BookmarkSubscribeRSS Feed
Sivanandam
Calcite | Level 5

Hi All,

When am executing the below code .

If the store(Member) is not present in the pds file('xo94.control.parm') it is failing with member not found .

Could you please help us how to avoid that error if the member is not found .

I can have a display message saying the member not found instead of failing.

FILENAME model'XO94.SAS.MODELID';

FILENAME rr'XO94.store';

data rename1;                                   

infile model;                                   

input store £;                                  

length ftrw £30.;                               

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

infile dummy filevar=ftrw1 sharebuffers end=done;

FILE DUMMY FILEVAR=FTRW1;                       

do until(done);                                 

input @1 renam £100.;                           

%INCLUDE rr;     //-- renam=tranwrd (renam,'2205','6453');---

put renam;                                      

end;                                            

run;                                            

Thanks,

Siva.

3 REPLIES 3
data_null__
Jade | Level 19

You will need to test if the value contained in FTRW1 exists.  Using either FEXIST or FILEEXIST.  I don't know which would be "best" given your OS and the value contain in FTRW1.  The following paper covers the subject will enough but does not specifically address your OS which I think is z/OS.

http://www2.sas.com/proceedings/sugi31/029-31.pdf

Check out the functions in the online docs, it will basically be something like...

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

if FILEEXIST(FTRW1) then do;

   putlog  'NOTE: File ' ftrw1 'does not exist';

   delete;

   end;

Sivanandam
Calcite | Level 5

Hi,

Its not working .is this the logic for  PDS member too.

Thanks.

SIva.

data_null__
Jade | Level 19

You will need to consult your OS specific documention.  As I said it goes "something like this".

Look a FEXIST function.  You will need to create a tempory FILEREF with the FILENAME function then test using FEXISTS.  It's all in the documentation.

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
  • 3 replies
  • 804 views
  • 0 likes
  • 2 in conversation