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.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.