Define query without WRKJOBSCDE

100 pts.
Tags:
AS/400 job scheduler
AS/400 Query
Work with Query
WRKQRY
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

Create a CL to run the query, make a job schedule entry to run the CL on Monday – Friday.

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • philpl1jb
    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
    49,550 pointsBadges:
    report
  • Teandy
    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.
    5,860 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following