Hello. We just completed our first Enterprise Guide project, we're currently working on scheduling via Cron. We wanted to schedule an entire process flow to ensure that our DB2 tables are picked up and run several times a day as they can be updated throughout the day. When we created the Enterprise Guide project, we dragged DB2 tables into the project instead of using an sql passthrough such as the following:
PROC SQL;
connect to db2 (uid="&MyMetaUser" password="&MyMetaPass" datasrc=DB2PRODA);
CREATE TABLE MYLIB.NEW_TABLE AS
SELECT * FROM CONNECTION TO DB2
(select * FROM DB2.OLD_TABLE
WHERE DEPT_ID IN ('___','____','____','____','____')
ORDER BY DEPT_ID, PRMY_LAST_NM);
QUIT;
What I want to know is whether we can schedule via cron if we drag DB2 tables instead of using passthrough sql? Is the passthrough sql required for cron to be able to process the entire project? Thanks!
Save your code to a .sas file on the UNIX server.
Log on as the userid intended for the batch run, via ssh or similar.
Run the newly created .sas file using the sasconf/Lev1/SASApp/BatchServer/sasbatch.sh script.
Inspect the resulting log.
Build a wrapper script for the sasbatch.sh that adds important options like -log etc.; this wrapper might also perform alerts if the sasbatch.sh returns with a non-zero return code.
(code the timestamp of the current time into the logfile name)
Create a script that calls this wrapper script with your programname
Add that script to your crontab
Inspect your logs regularly, or if you received an alert.
@Kurt_Bremser Does this mean that it really doesn't matter whether I use a passthrough sql or drag the DB2 table into the process flow? My .sas file should run fine in either case, right?
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.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.