BookmarkSubscribeRSS Feed
RamKumar
Fluorite | Level 6

When I ran this macro code in EG 5.1,encountered by error as follows.SAS is installed in UNIX server and the /data/PPM is directory where SAS resides.

Ideally I want this code to run, when file is not availble on sever and if there are files it should produce a dataset as mentioned in macros.

16         %let appfile =<None>;

17 

18         %macro do_work(infilename);

19         %if "&infilename" ne "<NONE>" %then %do;

20        

21         proc import datafile="/data/PPM/&infilename." out=appfile_cass dbms=CSV replace;

22              guessingrows=30000;

23         run;

24        

25         data want;

26         set appfile_cass;

27         run;

28        

29         %end;

30         %mend;

31        

32         %do_work(&appfile);

MLOGIC(DO_WORK):  Beginning execution.

MLOGIC(DO_WORK):  Parameter INFILENAME has value <None>

MLOGIC(DO_WORK):  %IF condition "&infilename" ne "<NONE>" is TRUE

MPRINT(DO_WORK):   proc import datafile="/data/PPM/<None>" out=appfile_cass dbms=CSV replace;

MPRINT(DO_WORK):   ADLM;

MPRINT(DO_WORK):   guessingrows=30000;

MPRINT(DO_WORK):   run;

NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to

WORK.PARMS.PARMS.SLIST.

ERROR: Physical file does not exist, /data/PPM/<None>.

Can someone guide me to achieve this task?

Thanks for any help provided.

1 REPLY 1
CTorres
Quartz | Level 8

check the case of the parameter:

%let appfile =<None>;

%if "&infilename" ne "<NONE>" %then %do;

CTorres

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 655 views
  • 0 likes
  • 2 in conversation