Hi all,
Please help me.
I want to automate the following programs by adding them to my crontab to run daily.
Instead of adding in several entries for the different programs to my crontab, how do I create a macro that has all the program calls in it?
Also before running the program each day I want the macro to check if the previous days data ran successfully and if the log dependancy for today is met before kicking of the jobs.
Eg: Prog02may2012.sas can only run if the Prog01may2012.sas ran successfully. Also the dependancy "extract.log.ok" needs to be met before I run any programs.
Hope this makes sense.
Thanks
how do I create a macro that has all the program calls in it?
This is very vague ... not clear at all why you want a Macro that has all program calls in it, when a program that doesn't have macros could also have all the program calls in them. Why do you need macros for this? What program calls are you referring to?
Also before running the program each day I want the macro to check if the previous days data ran successfully and if the log dependancy for today is met before kicking of the jobs.
Each day, if the program runs successfully, write the date and status (could be simply a 1 for success and 0 for fail) to a SAS data set. Next day, check to make sure the data set has a 1 on the previous day.
It does not necesarily have to be a macro, just thought that it will be more efficient.
When i referred to program calls - I mean calling several different programs at once.
Can you give me an example of two or three program calls? Are these SAS programs being called, or non-SAS programs?
When you say calling "several different programs at once", do you really mean "calling several different programs in sequence via one SAS program"?
Yes that is what I mean.
Eg: I want to run extract.sas then run load.sas
No macros needed, if I understand you properly. You just need to use the %include command
%include "\\server\share\extract.sas";
%include "\\server\share\load.sas";
Of course, you would use the exact path of these .sas files instead of \\server\share
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.