BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
bweeks59
Obsidian | Level 7

I am using this code to populate the date in filename as seen below but the output is not returning the date. Filename comes out like this SAS_backup_roll_&now1..xlsx  - This works fine in BASE SAS but not in VIYA Studio, using PROC Export as well to export multiple worksheets to the excel workbook. Any help will be greatly appreciated. 

 

%let now1=%sysfunc(today(),yymmddd10.);
filename backup filesrvc folderpath= '/USCG/Aviation Logistics Division/RMB/OUTPUTS/' filename='SAS_backup_roll_&now1..xlsx'; 

Proc export data=work.tpcA
outfile=backup
dbms=xlsx replace;
sheet='A-TPC funds';
run;

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

I'm not sure how it could ever work in any version of SAS with single quotes after filename=

 

It should work with double-quotes

 

... filename="SAS_backup_roll_&now1..xlsx"; 

 

unless there are other problems that are not obvious.

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

I'm not sure how it could ever work in any version of SAS with single quotes after filename=

 

It should work with double-quotes

 

... filename="SAS_backup_roll_&now1..xlsx"; 

 

unless there are other problems that are not obvious.

--
Paige Miller
bweeks59
Obsidian | Level 7

Thanks so much for catching the single quote, this worked perfectly after I made the change. I am reusing code someone else wrote and did not see this...not sure how it worked in BASE but that is she was using it before we upgraded to VIYA. Now I am curious if it really ran there but not looking back. I really appreciate the help, got into the weeds and could not see it. 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Discussion stats
  • 2 replies
  • 509 views
  • 0 likes
  • 2 in conversation