BookmarkSubscribeRSS Feed
MILKYLOVE
Calcite | Level 5

Hello,

 

I have a syntax error for below's code. 

 

ERROR:  No logical assign for filename FIC 

 

Can anyone please help?

 

%macro param_date();
             data _null_;
                 infile fic;
                input exec $12.;
                call symput("exec",compress(exec));
            run;
         
             data _null_;
                 %if ^%symexist(exec) %then %do;
                     data _null_;
                         set param.LANCEMENT_IMAGES_W6(where=(DT_DEB_PASSAGE<=date()<=DT_FIN_PASSAGE));
                         call symput('lib', cat(ANNEE_IMAGE, SEMAINE_IMAGE));
                         call symput('mois', LOWCASE(cat(ANNEE_IMAGE, SEMAINE_IMAGE))); 
                         call symputx("date_exec","'"||put(date(),date9.)||"'d","G");
                         call symputx("DATE_EXTRACTION","'"||put(intnx('week.2',date(),0,'e'),date9.)||"'d","G");
 
                     run;
                 %end;
                 %else %if &exec. ne %then %do;
                     data _null;
                         set param.LANCEMENT_IMAGES_W6(where=(DT_DEB_PASSAGE<=&exec.<=DT_FIN_PASSAGE));
                         call symput('lib', cat(ANNEE_IMAGE, SEMAINE_IMAGE));
                         call symput('mois', LOWCASE(cat(ANNEE_IMAGE, SEMAINE_IMAGE))); 
                         call symputx("date_exec","'"||put(dt_image,date9.)||"'d","G");
                         call symputx("DATE_EXTRACTION","'"||put(dt_image,date9.)||"'d","G"); 
                         call symputx("DATE_PREMIERE_PASS","'28MAR2018'd","G"); 
                     run;
                 %end;
             run;
         %mend;
         
         %param_date;
3 REPLIES 3
PaigeMiller
Diamond | Level 26

SAS doesn't know what fic is, because you haven't defined it. You need to tell SAS what file you want to denote as fic by using a FILENAME statement to point to the desired file.

--
Paige Miller
MILKYLOVE
Calcite | Level 5

This is a temporary file being created only for this macro variable to calculate a date.

 

How do I point to a file repository if I don't have one?

PaigeMiller
Diamond | Level 26

@MILKYLOVE wrote:

 

How do I point to a file repository if I don't have one?


You can't.

 

Your logic is flawed somewhere. The code requires reading something from the file identified as FIC, and yet you don't have such a file. You tell me how to fix this in words (not in SAS code), because I don't know what you are trying to do.

--
Paige Miller
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2126 views
  • 1 like
  • 2 in conversation