BookmarkSubscribeRSS Feed
Fluorite | Level 6

Is there a way to execute multiple SAS programs from one program with the use of macro variables in the path and the log?


1. I want dynamic dates in the log name

2. The location where the program resides and the log locations are different and both should employ a macro variable.


To achieve this, if I use a call command, I am guessing I cannot use dynamic paths or dates. If I use a %include statement, there is a restriction on the number of characters (LRECL should be <=6000).


Is there any way to trigger them in data null step or using a macro?

Super User

If I use a %include statement, there is a restriction on the number of characters (LRECL should be <=6000).


You have lines with more than 6000 characters? That seems like a problem in itself. %INCLUDE is always the method I've used.


Use PROC PRINTTO in your programs for the log and add the date using %SYSFUNC(). 



Fluorite | Level 6

@Reeza My bad, I thought the restriction was overall. Thank you very much for your suggestions

I used %include but there are two issues I am facing. (I am running using putty)


1. I used Printto, but the log file has only "Notes:" but doesn't show the actual lines of the code in log. Is that supposed to be that way? Usually on a log we see both lines of code and the Notes and Warnings.


2. If there is a Proc Import step in the sas program that we are calling using %include, the main program doesn't seem to run at all. It runs for a long time, the log file also stands still. Sample proc import that has been used:



DATAFILE= "&path./ABC.xlsx"





Super User

Check the documentation for %INCLUDE, I think there's an option you can set to have the code printed in the log as well as the notes and such.

Super User

And your PROC IMPORT is missing the RUN which is why it's hanging - SAS is waiting for it to terminate and you don't have a termination. 

Diamond | Level 26

LRECL is not a restriction on the number of characters.


It is a restriction on the number of characters on a single line of code. Are you writing code that has 6000 characters on one line?


I think %include will work fine.

Paige Miller

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 5 replies
  • 3 in conversation