BookmarkSubscribeRSS Feed
Anna_dlC
Obsidian | Level 7

I have added an additional section to an existing production job to validate some new parameters.  This job has been in production for years and the part(s) I have added is not where the error is occurring.   I can't figure out why it's failing when there's nothing new in that section - all the macro variables filling out the filename are resolving as expected.

 

This is the code that is failing.  The first snip (also in the attached document) shows the log, the 2nd snip shows the production output that is still currently running.

 

/*** CREATE PDF AUDIT file ***/
%let dte = %sysfunc (today(),date9.);
%let tme = %sysfunc (time(), tod8.);
%let out_audt= /rsmprod/CMA/PRA_OUT/audit;

data _null_;
filen2 = compress("&dte"||':'||"&tme"||"_"||"CI"||"&PDF_campaign_id._&fileid."||"_"||"CJB_VALIDATION"||".pdf");
call symput ('afilnme', filen2);
run;

filename _audt "&out_audt./&afilnme";

ods listing close;
options center;
ods pdf file= out_audt startpage=no;

 

Anna_dlC_0-1736978144728.png

 

Anna_dlC_1-1736978159855.png

 

4 REPLIES 4
SASKiwi
PROC Star

This is the problem statement:

ods pdf file= out_audt startpage=no;

There should be a FILENAME statement defining the OUT_AUDT FILEREF but I don't see one in the posted code. Alternatively OUT_AUDT could be a macro variable that points to an actual file in which case it should be defined like this:

ods pdf file= "&out_audt" startpage=no;
ChrisNZ
Tourmaline | Level 20

Shouldn't

filename _audt "&out_audt./&afilnme";

be

filename OUT_AUDT "&out_audt./&afilnme";

?

 

ChrisNZ
Tourmaline | Level 20

You can simplify this code with just:

 

filename OUT_AUDT "&out_audt/&dte:&tme._&CIPDF_campaign_id._&fileid._CJB_VALIDATION.pdf";
Stu_SAS
SAS Employee

Hey @Anna_dlC! Looking at this line here:

ods pdf file= out_audt startpage=no;

 

out_audt is not defined as a filename in the snippet. Instead, it is named _audt  as defined in this line:

filename _audt "&out_audt./&afilnme";

 

Try changing the ODS PDF statement to this:

ods pdf file= _audt startpage=no;

 

Or, change the filename statement to be out_audt:

filename out_audt "&out_audt./&afilnme";

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

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
  • 1026 views
  • 2 likes
  • 4 in conversation