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

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.

 

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