BookmarkSubscribeRSS Feed
weissalberich
Calcite | Level 5

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.

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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?

weissalberich
Calcite | Level 5

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.

 

 Edit Prompt_2017-08-01_10-55-03.jpg

ballardw
Super User

@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.

 

 Edit Prompt_2017-08-01_10-55-03.jpg


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

Reeza
Super User

What happens then that's unexpected, your code looks correct.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 2080 views
  • 0 likes
  • 4 in conversation