Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fail JCL if tape date not current month minus 1?

18 views
Skip to first unread message

Tim

unread,
Jan 7, 2010, 3:46:14 PM1/7/10
to
I'm running a job on JES2 MVS LEVEL 0807.03 z/OS V1R9 and have a job
that depends on a tape feed. In my JCL I want to programatically make
sure the date on the tape is the current year/month minus 1 month. If
it's not then I want to fail the job.

I currently do the check manually by doing a list catalog on the
dataset:
LISTC ENT('ACRO.TAPE.DATASET.NAME') HISTORY
NONVSAM ------- ACRO.TAPE.DATASET.NAME
IN-CAT --- UCAT.SYSC.GPWKCAT8
HISTORY
DATASET-OWNER-----(NULL) CREATION--------2009.332
RELEASE----------------2 EXPIRATION------0000.000

I then use a web site to convert the Julian date to a calendar date.

Any ideas on the best way to do this?

Joel C. Ewing

unread,
Jan 8, 2010, 3:05:42 PM1/8/10
to
My approach would be to write a REXX EXEC which returns a high return
code if the job should not run, include this in the job as a Batch TSO
step, and have the job conditionally terminate based on step condition
code.

From REXX you can internally issue the LISTC and capture and parse the
output, and the REXX DATE function should be able to supply the rest.
JC Ewing


--
Joel C. Ewing, Fort Smith, AR jREMOVEc...@acm.org

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to list...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Lizette Koehler

unread,
Jan 8, 2010, 3:32:22 PM1/8/10
to
If you have a job scheduling package, it can submit jobs based on dataset
creation. Or can do a few other tricks.

Or you can write a clist or rexx or sas or easytrieve that will figure out
if the creation date is within a date range.

There are probably other solutions as well.

You could also do a program in PL/1, ASM, COBOL, and probably others to do
the same thing.

Your solution will vary with what you are comfortable with supporting.

Lizette

>
> On 01/07/2010 02:46 PM, Tim wrote:
> > I'm running a job on JES2 MVS LEVEL 0807.03 z/OS V1R9 and have a job
> > that depends on a tape feed. In my JCL I want to programatically make
> > sure the date on the tape is the current year/month minus 1 month. If
> > it's not then I want to fail the job.
> >
> > I currently do the check manually by doing a list catalog on the
> > dataset:
> > LISTC ENT('ACRO.TAPE.DATASET.NAME') HISTORY
> > NONVSAM ------- ACRO.TAPE.DATASET.NAME
> > IN-CAT --- UCAT.SYSC.GPWKCAT8
> > HISTORY
> > DATASET-OWNER-----(NULL) CREATION--------2009.332
> > RELEASE----------------2 EXPIRATION------0000.000
> >
> > I then use a web site to convert the Julian date to a calendar date.
> >
> > Any ideas on the best way to do this?
>
>
> --

----------------------------------------------------------------------

McKown, John

unread,
Jan 8, 2010, 3:33:14 PM1/8/10
to
> -----Original Message-----
> From: IBM Mainframe Discussion List
> [mailto:IBM-...@bama.ua.edu] On Behalf Of Joel C. Ewing
> Sent: Friday, January 08, 2010 1:35 PM
> To: IBM-...@bama.ua.edu
> Subject: Re: Fail JCL if tape date not current month minus 1?
>
> My approach would be to write a REXX EXEC which returns a high return
> code if the job should not run, include this in the job as a Batch TSO
> step, and have the job conditionally terminate based on step condition
> code.
>
> From REXX you can internally issue the LISTC and capture and parse the
> output, and the REXX DATE function should be able to supply the rest.
> JC Ewing
>

That should work. But I will put in the obligatory mention that the LISTC output is not GUPI. Using IGGCSI00 is GUPI and less likely to fail in the future.

If the OP wanted a JCL error, then there is not really a way. Well, do the above to set the CC, then execute a different step with a guaranteed JCL error if the CC is set to bypass the real step.

--
John McKown
Systems Engineer IV
IT

Administrative Services Group

HealthMarkets(r)

9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * (817)-961-6183 cell
john....@healthmarkets.com * www.HealthMarkets.com

Confidentiality Notice: This e-mail message may contain confidential or proprietary information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets(r) is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance Company(r), Mid-West National Life Insurance Company of TennesseeSM and The MEGA Life and Health Insurance Company.SM

John Kelly

unread,
Jan 8, 2010, 3:39:24 PM1/8/10
to
<snip>

From REXX you can internally issue the LISTC and capture and parse the
output, and the REXX DATE function should be able to supply the rest.
</snip>

If you have RMM you can just use their REXX/CLIST interface to get the
date. TMS you're out of luck, you'll have to parse the LISTC output. But
REXX should convert the date to whatever format that you want without
going out to a web site, see Mark's RDATE REXX.

Jack Kelly
202-502-2390 (Office)

McKown, John

unread,
Jan 8, 2010, 3:46:10 PM1/8/10
to
> -----Original Message-----
> From: IBM Mainframe Discussion List
> [mailto:IBM-...@bama.ua.edu] On Behalf Of John Kelly
> Sent: Friday, January 08, 2010 2:39 PM
> To: IBM-...@bama.ua.edu
> Subject: Re: Fail JCL if tape date not current month minus 1?
>
> <snip>
> From REXX you can internally issue the LISTC and capture and
> parse the
> output, and the REXX DATE function should be able to supply the rest.
> </snip>
>
> If you have RMM you can just use their REXX/CLIST interface
> to get the
> date. TMS you're out of luck, you'll have to parse the LISTC
> output. But
> REXX should convert the date to whatever format that you want without
> going out to a web site, see Mark's RDATE REXX.
>
> Jack Kelly
> 202-502-2390 (Office)

It would be wonderful if CA would enhance CA-1 to have a REXX interface! Although, come to think of it, CA does document how to interface to CA-1 via an HLL. So some smart person could write an interface for an "ADDRESS CA1" environment in REXX.

--
John McKown
Systems Engineer IV
IT

Administrative Services Group

HealthMarkets(r)

9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * (817)-961-6183 cell
john....@healthmarkets.com * www.HealthMarkets.com

Confidentiality Notice: This e-mail message may contain confidential or proprietary information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. HealthMarkets(r) is the brand name for products underwritten and issued by the insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance Company(r), Mid-West National Life Insurance Company of TennesseeSM and The MEGA Life and Health Insurance Company.SM

----------------------------------------------------------------------

Paul Gilmartin

unread,
Jan 8, 2010, 4:45:53 PM1/8/10
to
On Fri, 8 Jan 2010 14:45:23 -0600, McKown, John wrote:
>
>It would be wonderful if CA would enhance CA-1 to have a REXX interface! Although, come to think of it, CA does document how to interface to CA-1 via an HLL. So some smart person could write an interface for an "ADDRESS CA1" environment in REXX.
>
Sometimes this is supplied, as with SDSF.

Sometimes this is easily done with address LINKPGM, as with ICSF.

Sometimes this is impractically difficult, as with SMP/E.

-- gil

0 new messages