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

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_10PRCapture1.JPG

1 ACCEPTED SOLUTION

Accepted Solutions
indra1975
Fluorite | Level 6

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.

View solution in original post

3 REPLIES 3
indra1975
Fluorite | Level 6

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.

Tom
Super User Tom
Super User

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().

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1198 views
  • 0 likes
  • 2 in conversation