Re: How to control in an JCL that a file is empty or not exist ?
- From: rkuebbin@xxxxxxxx (Kirk Talman)
- Date: 14 Jul 2011 14:28:09 -0700
Or write little program (skeleton ASM)
OPEN
LR R3,4
GET
LR R3,0 OR ...
EOF EQU *
RETURN w/R3 as return code in R15
can also be done in Cobol in same manner and probably all other languages
IBM Mainframe Discussion List <IBM-MAIN@xxxxxxxxxxx> wrote on 07/14/2011
09:22:05 AM:
From: Greg Shirey <WGShirey@xxxxxxxxxxxxx>?
To: IBM-MAIN@xxxxxxxxxxx
Date: 07/14/2011 09:31 AM
Subject: Re: How to control in an JCL that a file is empty or not exist
Sent by: IBM Mainframe Discussion List <IBM-MAIN@xxxxxxxxxxx>set.
As mentioned, LISTC will test for whether a file exists; ICETOOL
provides a method to test if a file is empty.
From "Smart DFSORT tricks" (ftp.software.ibm.com/storage/dfsort/mvs/
sorttrck.pdf)
For example, in the following ICETOOL job, the EMPTY operand of
COUNT is used to stop STEP2 from being executed if the IN data set
is empty. ICETOOL sets RC=8 (because the RC8 operand is specified)
if the IN data set is empty, or RC=0 if the IN data set is not
empty. ICETOOL only reads one record to determine if the data set is
empty or not empty, regardless of how many records there are in the data
//STEP1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=...
//TOOLIN DD *
* SET RC=8 IF THE 'IN' DATA SET IS EMPTY, OR
* SET RC=0 IF THE 'IN' DATA SET IS NOT EMPTY
COUNT FROM(IN) EMPTY RC8
/*
// IF STEP1.RC = 0 THEN
//*** STEP2 WILL RUN IF 'IN' IS NOT EMPTY
//*** STEP2 WILL NOT RUN IF 'IN' IS EMPTY
//STEP2 EXEC ...
...
// ENDIF
HTH,
Greg Shirey
Ben E. Keith Company
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@xxxxxxxxxxx] On
Behalf Of Hilario G.
Sent: Thursday, July 14, 2011 7:40 AM
To: IBM-MAIN@xxxxxxxxxxx
Subject: How to control in an JCL that a file is empty or not exist ?
Hello folks,
I have several batch processes that contain empty files or files
that do not exist.
I need to control the execution of certain programs based on the
existence of these files (including files created empty).
I try to used IDCAMS but didn't work in my tests.
Thank you very much everyone.
-----------------------------------------
The information contained in this communication (including any
attachments hereto) is confidential and is intended solely for the
personal and confidential use of the individual or entity to whom
it is addressed. If the reader of this message is not the intended
recipient or an agent responsible for delivering it to the intended
recipient, you are hereby notified that you have received this
communication in error and that any review, dissemination, copying,
or unauthorized use of this information, or the taking of any
action in reliance on the contents of this information is strictly
prohibited. If you have received this communication in error,
please notify us immediately by e-mail, and delete the original
message. Thank you
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to listserv@xxxxxxxxxxx with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
.
- Follow-Ups:
- Re: How to control in an JCL that a file is empty or not exist ?
- From: Scott Rowe
- Re: How to control in an JCL that a file is empty or not exist ?
- References:
- How to control in an JCL that a file is empty or not exist ?
- From: Hilario G.
- Re: How to control in an JCL that a file is empty or not exist ?
- From: Greg Shirey
- How to control in an JCL that a file is empty or not exist ?
- Prev by Date: Re: Z196 Cobol pgm with higher CPU
- Next by Date: Re: ACF2 SVCs -- Required?!?
- Previous by thread: Re: How to control in an JCL that a file is empty or not exist ?
- Next by thread: Re: How to control in an JCL that a file is empty or not exist ?
- Index(es):
Relevant Pages
|