12-21-2017 10:07 AM
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:
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);
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!
12-21-2017 11:09 AM
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.
12-21-2017 11:27 AM
@KurtBremser 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?
12-21-2017 11:43 AM