Desktop productivity for business analysts and programmers

Scheduling EG Project (physical tables)

Reply
New Contributor
Posts: 3

Scheduling EG Project (physical tables)

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!

Super User
Posts: 9,550

Re: Scheduling EG Project (physical tables)

Posted in reply to SASUser_86

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.

 

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
New Contributor
Posts: 3

Re: Scheduling EG Project (physical tables)

Posted in reply to KurtBremser

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

Super User
Posts: 5,824

Re: Scheduling EG Project (physical tables)

Posted in reply to SASUser_86
Is just different syntax.
The choices between the two have nothing to do with scheduling (as long you are handling the DB2 login - which is part of your system test).
I get a bit worried when seeing metauser and metapassword as names for your macro variables - SAS metadata user and passwords are many times not the same as in the database.
Data never sleeps
Ask a Question
Discussion stats
  • 3 replies
  • 103 views
  • 0 likes
  • 3 in conversation