BookmarkSubscribeRSS Feed
Havi
Obsidian | Level 7

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

5 REPLIES 5
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
Havi
Obsidian | Level 7

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.

PaigeMiller
Diamond | Level 26

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

--
Paige Miller
Havi
Obsidian | Level 7

Yes that is what I mean.

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

PaigeMiller
Diamond | Level 26

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

--
Paige Miller

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
  • 5 replies
  • 924 views
  • 0 likes
  • 2 in conversation