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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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