× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



On Wed, Nov 27, 2019 at 6:44 AM Alan Shore via MIDRANGE-L <
midrange-l@xxxxxxxxxxxxxxxxxx> wrote:

We have a WRKJOBSCDE that is scheduled to run every Saturday @ 7:00 a.m.
The users would now like this to be run on the first of each month as well
- also @ 7:00 a.m.


I have a weekly backup job and then a monthly.

I hold the weekly for the monthly using a Python script.

I run the Python script on the day of the backup (Saturday e,g., day 7)
launched from a CL.

You can do the same thing for specific dates, days, months, etc. Python's
datetime module is rich.


*hold1st.py *

import datetime
import sys
from subprocess import call

x = datetime.date.today().day

if x <= 7 :
thecall = "QSYS/HLDJOBSCDE JOB(WEEKLYSAV)"
else:
thecall = "QSYS/RLSJOBSCDE JOB(WEEKLYSAV)"

call(["/QOpenSys/usr/bin/system", thecall])

*HOLD1STMTH CLP*

PGM
CALL PGM(QP2SHELL) +
PARM('/QOpenSys/pkgs/bin/python3' +
'/home/JWOEHR/hold1st.py')
ENDPGM


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.