DATA Step, Macro, Functions and more

Need help with automating macros

Reply
Contributor
Posts: 36

Need help with automating macros

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

Trusted Advisor
Posts: 1,923

Re: Need help with automating macros

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.

Contributor
Posts: 36

Re: Need help with automating macros

Posted in reply to PaigeMiller

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.

Trusted Advisor
Posts: 1,923

Re: Need help with automating macros

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"?

Contributor
Posts: 36

Re: Need help with automating macros

Posted in reply to PaigeMiller

Yes that is what I mean.

Eg: I want to run extract.sas then run load.sas

Trusted Advisor
Posts: 1,923

Re: Need help with automating macros

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

Ask a Question
Discussion stats
  • 5 replies
  • 230 views
  • 0 likes
  • 2 in conversation