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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 4 replies
  • 1166 views
  • 0 likes
  • 4 in conversation