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.

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