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;
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.
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?
@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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.