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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 968 views
  • 0 likes
  • 2 in conversation