I'm trying to include the value of two prompts I have generated in SAS EG in the filename during a PROC EXPORT step. One prompt is numeric and resolves in the file name just fine, but the other prompt is a date and I keep getting WARNING: Apparent symbolic reference LOOKBACKSTARTDATE not resolved.
My code:
PROC Export DATA=WORK.MONTHLYCOMPILED
OUTFILE="C:\Documents\SASoutput\monthly_&lookbackstartdate._&txstartcohort..csv"
DBMS=csv
REPLACE;
RUN;
The date variable - &loobackstartdate - describes the start date for the data set that went into the anlaysis. It's not like a date/time stamp for the run itself, so using a function that inserts today's date is not what I'm going for.
I played around with trying to convert &lookbackstartdate into text and saving that as another variable with a preceding %let step, but I'm just tripping over myself on how to do that.
So where is &lookbackstartdate. defined? The warning is telling you that there is no macro variable by that name in the current scope. Not sure how we could help you further without some information?
It's defined via a prompt I created in SAS EG, and set to be used throughout the project. It is used in other queries in the project to restrict data. It's the same thing I have done for the numeric txstartcohort variable that does resolve correctly.
@weissalberich wrote:
It's defined via a prompt I created in SAS EG, and set to be used throughout the project. It is used in other queries in the project to restrict data. It's the same thing I have done for the numeric txstartcohort variable that does resolve correctly.
You don't show the name used in the construction. I would triple check spelling for your use &LOOKBACKSTARTDATE. Perhaps the entry screen cutoff a few characters or you accidentaly used LOOKBACKSTARTDATA or similar
What happens then that's unexpected, your code looks correct.
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.
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.