Hello,
I am facing a problem with a code that has worked for me before. At the end of every job, I like to archive a copy of the sas codes that were used in the job using the following line:
%sysexec copy "&path.*.sas" "&Code_lib.*"/Y ;
where &path and &Code_lib are directory paths.
The code executes but the resulting filenames in the &code_lib are like " .sas", " 1_csv.sas" (see attached screenshot). Can somebody please give any pointers to solve this problem.
Here are some additional facts:
- &path and &code_lib are both mapped network drives
- &path is about 87 char in length
- &code_lib is about 130 char in length
- Longest sas file name string is 32 char in length
- Running SAS 9.4 on X64_10PR
Withdrawing the question. I was able to solve the problem by configuring &path and &Code_lib using %let statement instead of a call symput. When using the latter the &path and &code_lib is set to the length as characterized in the dataset. Thank you for your attention.
Withdrawing the question. I was able to solve the problem by configuring &path and &Code_lib using %let statement instead of a call symput. When using the latter the &path and &code_lib is set to the length as characterized in the dataset. Thank you for your attention.
Unless you need to store leading and/or trailing spaces in your macro variables you should always use newer CALL SYMPUTX() function instead of CALL SYMPUT().
Thank you.
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.
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.