How can I Define a query to run only Monday thru Friday not using WRKJOBSCDE (we have a customised WRKQRY) scheduler and doesn't have an option to input the schedule day e.g. *Mon *Tues =, etc....I'll like to see if any one knows how to Define the query using the DEFINE RESULTS FIELDS e.g. YESTERDAY TODAY - 4 day but, for a week using only MON,TUE,WED,FRI only.
thanks
Not an answer -- but ..
I don't think so.
You could use something like you've described to eliminate the selection of all rows on Saturday and Sunday but the query would still run and create a spool file with headings (or an empty physical file if you're selected file output)
If you're scheduler could call a CL program, then the CL could evaluate the day and only run the query on selected days.
Phil
I don't understand what having a customized WRKQRY command has to do with WRKJOBSCDE. What happens when you use the WRKJOBSCDE command? Does the job run only once or does it run every day? If it runs every day, then try the following:
Create a CL that checks the day of the week. If it is between Monday and Friday, run the query. Let it run every day.
PGM
DCL VAR(&WEEKDAYNAM) TYPE(*CHAR) LEN(4) VALUE(' ')
RTVSYSVAL SYSVAL(QDAYOFWEEK) RTNVAR(&WEEKDAYNAM)
IF COND(&WEEKDAYNAM = '*MON' *OR &WEEKDAYNAM = +
'*TUE' *OR &WEEKDAYNAM = '*WED' *OR +
&WEEKDAYNAM = '*THR' *OR &WEEKDAYNAM = +
'*FRI') THEN(RUNQRY QRY(MYQUERY))
ENDPGM
Other wise you can use the SBMJOB command to schedule the job to run on a specific date and time for each date you want the job to run.
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 2  Replies