11-07-2013 08:52 AM
I need to schedule a sas program in batch and at the max program should be run twice in a day. I need a control table for sure but how to get the logic is something i am not getting.
Contro table structure is something like
So my flag is set to 0 at beginning of the day say at 00:00 and it gets set to 1 when program is run successfully.
How do I get it done? Thanks in advance
11-07-2013 09:53 AM
Can you describe what problem you are facing? Is the scheduling part, or updating the control table?
Usually I use macro calls for this, when the jobs starts, create row, when job ends, update with end status or whatever information you need.
11-07-2013 11:03 AM
Hi Linus ,
I have problems in scheduling and confusion in updating control table. Confusion is what should flag be by end of day and how to get information for next day. SAY today job run twice successfully and its flagged as 1. So how do I set flag as 0 tomorrow.
11-07-2013 11:14 AM
Scheduling: what scheduling tool will you use? What kind of SAS product are available for you (intelligence platform...?) What platform are you on?
Logging: use the start datetime for the job as a key. Each execution of the job will have it's own row. It will be easy to see when a job has not started at all. Who will look into this log table?
11-07-2013 11:26 AM
We have LSF. However my client is curious to know if we execute this manually in DI job. There certainly is user written code in that and say two different users run this code in shift times. Morning guy in morning n evening guy in evening.
My question still remains same. How should I get flags correct. Some sample code would be extremely helpful. Log table is also under our control its structure is also not defined so we can manipulate the way we want to
11-07-2013 05:27 PM
Running manually in DIS is not really scheduling... ;-)
insert into control.joblog (program_name, time_when_run, date_when_run, flag)
(&Job, "&SysTime"t, "&SysDate9"dt, 0)
%macro change_flag(job, time = &SysTime, date = &SysDate);
set flag = 1
where job_name = "&Job" and time_when_run="&Time"t and date_when_run="&Date"d
Untested... see as an idea.
Can't figure out what you want to store count, could easily be created when querying the log table.
11-08-2013 10:22 AM
Of course. to state the obvious, running the job directly from within DIS has the same effect as running the job from a scheduler, just not scheduled.
Scheduling a job to run twice a day is straight forward using SMC Schedule Manager (when it is fronting a Platform LSF scheduler instance). Do you need help doing that?