Re: How to control in an JCL that a file is empty or not exist ?

2011-07-19 Thread Cris Hernandez #9
how about making sure the file is created?  and put a header record in so it 
ain't empty? 

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


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-18 Thread John Mattson
I created these a while back for my programmers.  Just use Batch TSO to 
invoke 

=== pass a DD to this one 
/* rexx*/ 
   trace i 
arg dd 
 
/* rexx */ 
x = listdsi( dd FILE) 
 
if (SysUSED = 0) | (SysUSED = 'N/A') then DO 
   trace 
   Say '*** ' 
   Say '*** Dataset IS EMPTY DD: ' dd 
   Say '*** ' 
   exit 6 
End 
exit 0 

(OR) 

=== pass the DSN as a parm. 
/* rexx */ 
/* trace i */ 
arg dsn 
ALLOC DD(MT) DSN('||dsn||') SHR  
if rc  0 then DO 
   Say '*** ' 
   Say '*** Failure to alloc ds: ' dsn 
   Say '*** Either in use, or does not exist ' 
   Say '*** ' 
   exit 12 
End 
 
execio 1 diskr MT (stem rec. finis) 
cc=rc 
free dd(MT) 
if cc  0 then DO 
   Say '*** ' 
   Say '*** Dataset IS EMPTY ds: ' dsn 
   Say '*** ' 
   exit 6 
End 
exit0 

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


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-15 Thread Vernooij, CP - SPLXM
Paul Gilmartin paulgboul...@aim.com wrote in message
news:4831503745945372.wa.paulgboulderaim@bama.ua.edu...
 On Thu, 14 Jul 2011 19:48:36 +0200, Vernooij, CP - SPLXM wrote:
 
 I don't consider this exceptionally ideal, only normal practice. In
our
 systems, all datasets are SMS managed and therefor cataloged. All
tapes
 are supposed to be cataloged and in fact, we have no processes
running
 with uncataloged tapes. Even tapes coming from our TPF systems are
 administrated in the CA1 TMC and cataloged in the catalogs, so they
can
 also be processed them as normal, cataloged datasets.
  
 Do you use no tapes as an interchange medium?
 
 -- gil
 

Use no tapes? 
Yes, we use our TS7700 tapes as interchange medium.
Kees.

For information, services and offers, please visit our web site: 
http://www.klm.com. This e-mail and any attachment may contain confidential and 
privileged material intended for the addressee only. If you are not the 
addressee, you are notified that no part of the e-mail or any attachment may be 
disclosed, copied or distributed, and that any other action related to this 
e-mail or attachment is strictly prohibited, and may be unlawful. If you have 
received this e-mail by error, please notify the sender immediately by return 
e-mail, and delete this message. 

Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its 
employees shall not be liable for the incorrect or incomplete transmission of 
this e-mail or any attachments, nor responsible for any delay in receipt. 
Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch 
Airlines) is registered in Amstelveen, The Netherlands, with registered number 
33014286



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


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-15 Thread Scott Rowe
Kirk,

I don't think your little code sample would work as you intended, try LA
instead of LR ;-)

On Thu, Jul 14, 2011 at 5:24 PM, Kirk Talman rkueb...@tsys.com wrote:

 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@bama.ua.edu wrote on 07/14/2011
 09:22:05 AM:

  From: Greg Shirey wgshi...@benekeith.com
  To: IBM-MAIN@bama.ua.edu
  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@bama.ua.edu
 
  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
 set.
 
  //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@bama.ua.edu] On
  Behalf Of Hilario G.
  Sent: Thursday, July 14, 2011 7:40 AM
  To: IBM-MAIN@bama.ua.edu
  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 lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
 Search the archives at http://bama.ua.edu/archives/ibm-main.html


CONFIDENTIALITY/EMAIL NOTICE: The material in this transmission contains
confidential and privileged information intended only for the addressee.
If you are not the intended recipient, please be advised that you have
received this material in error and that any forwarding, copying, printing,
distribution, use or disclosure of the material is strictly prohibited.
If you have received this material in error, please (i) do not read it,
(ii) reply to the sender that you received the message in error, and
(iii) erase or destroy the material. Emails are not secure and can be
intercepted, amended, lost or destroyed, or contain viruses. You are deemed
to have accepted these risks if you communicate with us by email. Thank you.

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


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-15 Thread Kirk Talman
ouch - thanks

old fingers faster than old brain

IBM Mainframe Discussion List IBM-MAIN@bama.ua.edu wrote on 07/15/2011 
09:49:19 AM:

 From: Scott Rowe scott.r...@joann.com
 To: IBM-MAIN@bama.ua.edu
 Date: 07/15/2011 09:50 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@bama.ua.edu
 
 Kirk,
 
 I don't think your little code sample would work as you intended, try LA
 instead of LR ;-)
 
 On Thu, Jul 14, 2011 at 5:24 PM, Kirk Talman rkueb...@tsys.com wrote:
 
  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@bama.ua.edu wrote on 
07/14/2011
  09:22:05 AM:
 
   From: Greg Shirey wgshi...@benekeith.com
   To: IBM-MAIN@bama.ua.edu
   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@bama.ua.edu
  
   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
  set.
  
   //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@bama.ua.edu] On
   Behalf Of Hilario G.
   Sent: Thursday, July 14, 2011 7:40 AM
   To: IBM-MAIN@bama.ua.edu
   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 lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
  Search the archives at http://bama.ua.edu/archives/ibm-main.html
 
 
 CONFIDENTIALITY/EMAIL NOTICE: The material in this transmission contains
 confidential and privileged information intended only for the addressee.
 If you are not the intended recipient, please be advised that you have
 received this material in error and that any forwarding, copying, 
printing,
 distribution, use or disclosure of the material is strictly prohibited.
 If you have received this material in error, please (i) do not read it,
 (ii) reply to the sender that you received the message in error, and
 (iii) erase or destroy the material. Emails are not secure and can be
 intercepted, amended, lost or destroyed, or contain viruses. You are 
deemed
 to have accepted these risks if you communicate with us by email. Thank 
you.
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
 Search the archives at http://bama.ua.edu/archives/ibm-main.html


-
The information contained in this 

How to control in an JCL that a file is empty or not exist ?

2011-07-14 Thread Hilario G.
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. 

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


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-14 Thread Vernooij, CP - SPLXM
Hilario G. libr...@gmail.com wrote in message
news:0942850873937644.wa.librafegmail@bama.ua.edu...
 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. 
 

IDCAMS LISTC will give a returncode based on the result, i.e. the
existence of the file.

Kees.

For information, services and offers, please visit our web site: 
http://www.klm.com. This e-mail and any attachment may contain confidential and 
privileged material intended for the addressee only. If you are not the 
addressee, you are notified that no part of the e-mail or any attachment may be 
disclosed, copied or distributed, and that any other action related to this 
e-mail or attachment is strictly prohibited, and may be unlawful. If you have 
received this e-mail by error, please notify the sender immediately by return 
e-mail, and delete this message. 

Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its 
employees shall not be liable for the incorrect or incomplete transmission of 
this e-mail or any attachments, nor responsible for any delay in receipt. 
Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch 
Airlines) is registered in Amstelveen, The Netherlands, with registered number 
33014286



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


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-14 Thread McKown, John
You say in JCL. The only way that I can think of, off hand, is to run an 
IEFBR14 step at the beginning of the job similar to:

//STEP0001 EXEC PGM=IEFBR14
//DD1 DD DSN=first.file,DISP=(MOD,CATLG),
// UNIT=SYSDA,SPACE=(TRK,1),
// DCB=(...dcb parameters,DSORG=PS)
//DD2 DD DSN=second.file,DISP=(MOD,CATLG),
// UNIT=SYSDA,SPACE=(TRK,1),
// DCB=(...dcb parameters,DSORG=PS)

As I understand it anymore, if the dataset does not exist, this will allocate 
it, catalog it, AND write an EOF record on it. If the dataset already exists, 
it just allocates it, but does nothing else. The writing of the EOF record for 
a new allocation may require that the dataset be SMS managed. I forget if that 
is still a requirement. We do this all the time here. 

--
John McKown 
Systems Engineer IV
IT

Administrative Services Group

HealthMarkets(r)

9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone * 
john.mck...@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

 -Original Message-
 From: IBM Mainframe Discussion List 
 [mailto:IBM-MAIN@bama.ua.edu] On Behalf Of Hilario G.
 Sent: Thursday, July 14, 2011 7:40 AM
 To: IBM-MAIN@bama.ua.edu
 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. 
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
 Search the archives at http://bama.ua.edu/archives/ibm-main.html
 
 

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


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-14 Thread R.S.

In JCL ? Impossible or very hard.

However it it perfectly possible and IMHO convenient to add a step to 
your JCL. In this step you have to run some utility. If you don't have 
such utility, then I would suggest to use REXX script with LISTDSI.


--
Radoslaw Skorupka
Lodz, Poland



-Original Message-

From: IBM Mainframe Discussion List
[mailto:IBM-MAIN@bama.ua.edu] On Behalf Of Hilario G.
Sent: Thursday, July 14, 2011 7:40 AM
To: IBM-MAIN@bama.ua.edu
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.




--
Tre tej wiadomoci moe zawiera informacje prawnie chronione Banku 
przeznaczone wycznie do uytku subowego adresata. Odbiorc moe by jedynie 
jej adresat z wyczeniem dostpu osób trzecich. Jeeli nie jeste adresatem 
niniejszej wiadomoci lub pracownikiem upowanionym do jej przekazania 
adresatowi, informujemy, e jej rozpowszechnianie, kopiowanie, rozprowadzanie 
lub inne dziaanie o podobnym charakterze jest prawnie zabronione i moe by 
karalne. Jeeli otrzymae t wiadomo omykowo, prosimy niezwocznie 
zawiadomi nadawc wysyajc odpowied oraz trwale usun t wiadomo 
wczajc w to wszelkie jej kopie wydrukowane lub zapisane na dysku.

This e-mail may contain legally privileged information of the Bank and is intended solely for business use of the addressee. This e-mail may only be received by the addressee and may not be disclosed to any third parties. If you are not the intended addressee of this e-mail or the employee authorised to forward it to the addressee, be advised that any dissemination, copying, distribution or any other similar activity is legally prohibited and may be punishable. If you received this e-mail by mistake please advise the sender immediately by using the reply facility in your e-mail software and delete permanently this e-mail including any copies of it either printed or saved to hard drive. 


BRE Bank SA, 00-950 Warszawa, ul. Senatorska 18, tel. +48 (22) 829 00 00, fax 
+48 (22) 829 00 33, e-mail: i...@brebank.pl
Sd Rejonowy dla m. st. Warszawy XII Wydzia Gospodarczy Krajowego Rejestru Sdowego, nr rejestru przedsibiorców KRS 025237, NIP: 526-021-50-88. 
Wedug stanu na dzie 01.01.2011 r. kapita zakadowy BRE Banku SA (w caoci wpacony) wynosi 168.346.696 zotych.


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


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-14 Thread Walter Marguccio
 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. 

IDCAMS should work fine when you need to know if a given dataset exists or not:
    LISTC ENT('A.B.C')
If A.B.C does not exist, you would get a rc=4, and you can 
execute the next step conditionally with the IF-THEN-ELSE capability.

Likewise, if you want to check if a dataset is empty, IDCAMS is your friend:
    REPRO IDS('A.B.C')  OFILE(DD1) COUNT(1)  
If A.B.C is empty, you receive a rc=4.

HTH

Walter Marguccio
z/OS Systems Programmer
BELENUS LOB Informatic GmbH
Munich - Germany

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


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-14 Thread Greg Shirey
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 set.

//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@bama.ua.edu] On Behalf Of 
Hilario G.
Sent: Thursday, July 14, 2011 7:40 AM
To: IBM-MAIN@bama.ua.edu
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. 

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

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


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-14 Thread Ed Gould
John,

It depends. Iefbr14 itself does not open close the data set so no EOF is 
written, except if it's a SMS dataset AND the right parameter in IGDSMSxx 
parmlib member.

Ed

Sent from my iPad

On Jul 14, 2011, at 8:01 AM, McKown, John john.mck...@healthmarkets.com 
wrote:

 You say in JCL. The only way that I can think of, off hand, is to run an 
 IEFBR14 step at the beginning of the job similar to:
 
 //STEP0001 EXEC PGM=IEFBR14
 //DD1 DD DSN=first.file,DISP=(MOD,CATLG),
 // UNIT=SYSDA,SPACE=(TRK,1),
 // DCB=(...dcb parameters,DSORG=PS)
 //DD2 DD DSN=second.file,DISP=(MOD,CATLG),
 // UNIT=SYSDA,SPACE=(TRK,1),
 // DCB=(...dcb parameters,DSORG=PS)
 
 As I understand it anymore, if the dataset does not exist, this will allocate 
 it, catalog it, AND write an EOF record on it. If the dataset already exists, 
 it just allocates it, but does nothing else. The writing of the EOF record 
 for a new allocation may require that the dataset be SMS managed. I forget if 
 that is still a requirement. We do this all the time here. 
 
 --
 John McKown 
 Systems Engineer IV
 IT
 
 Administrative Services Group
 
 HealthMarkets(r)
 
 9151 Boulevard 26 * N. Richland Hills * TX 76010
 (817) 255-3225 phone * 
 john.mck...@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
 
 -Original Message-
 From: IBM Mainframe Discussion List 
 [mailto:IBM-MAIN@bama.ua.edu] On Behalf Of Hilario G.
 Sent: Thursday, July 14, 2011 7:40 AM
 To: IBM-MAIN@bama.ua.edu
 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. 
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
 Search the archives at http://bama.ua.edu/archives/ibm-main.html
 
 
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
 Search the archives at http://bama.ua.edu/archives/ibm-main.html

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


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-14 Thread Ed Gould
Kees,

In an ideal world yes. However just because a data set is cataloged, it doesn't 
necessarily exist ie space allocated on a dataset and or cataloged to a tape 
but the tape is not might now belong to someone see.

Ed

Sent from my iPad

On Jul 14, 2011, at 7:58 AM, Vernooij, CP - SPLXM kees.verno...@klm.com 
wrote:

 Hilario G. libr...@gmail.com wrote in message
 news:0942850873937644.wa.librafegmail@bama.ua.edu...
 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. 
 
 
 IDCAMS LISTC will give a returncode based on the result, i.e. the
 existence of the file.
 
 Kees.
 
 For information, services and offers, please visit our web site: 
 http://www.klm.com. This e-mail and any attachment may contain confidential 
 and privileged material intended for the addressee only. If you are not the 
 addressee, you are notified that no part of the e-mail or any attachment may 
 be disclosed, copied or distributed, and that any other action related to 
 this e-mail or attachment is strictly prohibited, and may be unlawful. If you 
 have received this e-mail by error, please notify the sender immediately by 
 return e-mail, and delete this message. 
 
 Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its 
 employees shall not be liable for the incorrect or incomplete transmission of 
 this e-mail or any attachments, nor responsible for any delay in receipt. 
 Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch 
 Airlines) is registered in Amstelveen, The Netherlands, with registered 
 number 33014286
 

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

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


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-14 Thread Vernooij, CP - SPLXM
Ed,

I don't consider this exceptionally ideal, only normal practice. In our
systems, all datasets are SMS managed and therefor cataloged. All tapes
are supposed to be cataloged and in fact, we have no processes running
with uncataloged tapes. Even tapes coming from our TPF systems are
administrated in the CA1 TMC and cataloged in the catalogs, so they can
also be processed them as normal, cataloged datasets.

Hillario does not mention what his normal situation is and if he needs
to be able to handle exotic circumstances, but if not, I consider IDCAMS
LISTC the right tool.

Kees.


Ed Gould ps2...@yahoo.com wrote in message
news:877469a4-08fc-4afb-a310-f4acf539b...@yahoo.com...
 Kees,
 
 In an ideal world yes. However just because a data set is cataloged,
it doesn't necessarily exist ie space allocated on a dataset and or
cataloged to a tape but the tape is not might now belong to someone
see.
 
 Ed
 
 Sent from my iPad
 
 On Jul 14, 2011, at 7:58 AM, Vernooij, CP - SPLXM
kees.verno...@klm.com wrote:
 
  Hilario G. libr...@gmail.com wrote in message
  news:0942850873937644.wa.librafegmail@bama.ua.edu...
  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. 
  
  
  IDCAMS LISTC will give a returncode based on the result, i.e. the
  existence of the file.
  
  Kees.
  
  For information, services and offers, please visit our web site:
http://www.klm.com. This e-mail and any attachment may contain
confidential and privileged material intended for the addressee only. If
you are not the addressee, you are notified that no part of the e-mail
or any attachment may be disclosed, copied or distributed, and that any
other action related to this e-mail or attachment is strictly
prohibited, and may be unlawful. If you have received this e-mail by
error, please notify the sender immediately by return e-mail, and delete
this message. 
  
  Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries
and/or its employees shall not be liable for the incorrect or incomplete
transmission of this e-mail or any attachments, nor responsible for any
delay in receipt. 
  Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal
Dutch Airlines) is registered in Amstelveen, The Netherlands, with
registered number 33014286
  
 
  
 
--
  For IBM-MAIN subscribe / signoff / archive access instructions,
  send email to lists...@bama.ua.edu with the message: GET IBM-MAIN
INFO
  Search the archives at http://bama.ua.edu/archives/ibm-main.html
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
 Search the archives at http://bama.ua.edu/archives/ibm-main.html

For information, services and offers, please visit our web site: 
http://www.klm.com. This e-mail and any attachment may contain confidential and 
privileged material intended for the addressee only. If you are not the 
addressee, you are notified that no part of the e-mail or any attachment may be 
disclosed, copied or distributed, and that any other action related to this 
e-mail or attachment is strictly prohibited, and may be unlawful. If you have 
received this e-mail by error, please notify the sender immediately by return 
e-mail, and delete this message. 

Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its 
employees shall not be liable for the incorrect or incomplete transmission of 
this e-mail or any attachments, nor responsible for any delay in receipt. 
Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch 
Airlines) is registered in Amstelveen, The Netherlands, with registered number 
33014286



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


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-14 Thread Paul Gilmartin
On Thu, 14 Jul 2011 19:48:36 +0200, Vernooij, CP - SPLXM wrote:

I don't consider this exceptionally ideal, only normal practice. In our
systems, all datasets are SMS managed and therefor cataloged. All tapes
are supposed to be cataloged and in fact, we have no processes running
with uncataloged tapes. Even tapes coming from our TPF systems are
administrated in the CA1 TMC and cataloged in the catalogs, so they can
also be processed them as normal, cataloged datasets.
 
Do you use no tapes as an interchange medium?

-- gil

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


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-14 Thread Kirk Talman
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@bama.ua.edu wrote on 07/14/2011 
09:22:05 AM:

 From: Greg Shirey wgshi...@benekeith.com
 To: IBM-MAIN@bama.ua.edu
 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@bama.ua.edu
 
 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 
set.
 
 //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@bama.ua.edu] On
 Behalf Of Hilario G.
 Sent: Thursday, July 14, 2011 7:40 AM
 To: IBM-MAIN@bama.ua.edu
 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 lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-14 Thread Ed Gould
Kees,

There are few systems out there that running exactly according to Hoyle. I have 
seen corporate politics over rule how things should work. 

Ed
Sent from my iPad

On Jul 14, 2011, at 12:48 PM, Vernooij, CP - SPLXM kees.verno...@klm.com 
wrote:

 Ed,
 
 I don't consider this exceptionally ideal, only normal practice. In our
 systems, all datasets are SMS managed and therefor cataloged. All tapes
 are supposed to be cataloged and in fact, we have no processes running
 with uncataloged tapes. Even tapes coming from our TPF systems are
 administrated in the CA1 TMC and cataloged in the catalogs, so they can
 also be processed them as normal, cataloged datasets.
 
 Hillario does not mention what his normal situation is and if he needs
 to be able to handle exotic circumstances, but if not, I consider IDCAMS
 LISTC the right tool.
 
 Kees.
 
 
 Ed Gould ps2...@yahoo.com wrote in message
 news:877469a4-08fc-4afb-a310-f4acf539b...@yahoo.com...
 Kees,
 
 In an ideal world yes. However just because a data set is cataloged,
 it doesn't necessarily exist ie space allocated on a dataset and or
 cataloged to a tape but the tape is not might now belong to someone
 see.
 
 Ed
 
 Sent from my iPad
 
 On Jul 14, 2011, at 7:58 AM, Vernooij, CP - SPLXM
 kees.verno...@klm.com wrote:
 
 Hilario G. libr...@gmail.com wrote in message
 news:0942850873937644.wa.librafegmail@bama.ua.edu...
 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. 
 
 
 IDCAMS LISTC will give a returncode based on the result, i.e. the
 existence of the file.
 
 Kees.
 
 For information, services and offers, please visit our web site:
 http://www.klm.com. This e-mail and any attachment may contain
 confidential and privileged material intended for the addressee only. If
 you are not the addressee, you are notified that no part of the e-mail
 or any attachment may be disclosed, copied or distributed, and that any
 other action related to this e-mail or attachment is strictly
 prohibited, and may be unlawful. If you have received this e-mail by
 error, please notify the sender immediately by return e-mail, and delete
 this message. 
 
 Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries
 and/or its employees shall not be liable for the incorrect or incomplete
 transmission of this e-mail or any attachments, nor responsible for any
 delay in receipt. 
 Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal
 Dutch Airlines) is registered in Amstelveen, The Netherlands, with
 registered number 33014286
 
 
 
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: GET IBM-MAIN
 INFO
 Search the archives at http://bama.ua.edu/archives/ibm-main.html
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
 Search the archives at http://bama.ua.edu/archives/ibm-main.html
 
 For information, services and offers, please visit our web site: 
 http://www.klm.com. This e-mail and any attachment may contain confidential 
 and privileged material intended for the addressee only. If you are not the 
 addressee, you are notified that no part of the e-mail or any attachment may 
 be disclosed, copied or distributed, and that any other action related to 
 this e-mail or attachment is strictly prohibited, and may be unlawful. If you 
 have received this e-mail by error, please notify the sender immediately by 
 return e-mail, and delete this message. 
 
 Koninklijke Luchtvaart Maatschappij NV (KLM), its subsidiaries and/or its 
 employees shall not be liable for the incorrect or incomplete transmission of 
 this e-mail or any attachments, nor responsible for any delay in receipt. 
 Koninklijke Luchtvaart Maatschappij N.V. (also known as KLM Royal Dutch 
 Airlines) is registered in Amstelveen, The Netherlands, with registered 
 number 33014286
 

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

--
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to 

Re: How to control in an JCL that a file is empty or not exist ?

2011-07-14 Thread Doug

On 7/14/2011 08:40, Hilario G. wrote:

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.

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

If the file exists, IDCAMS print with count of one will tell if it is 
empty or not.


IDCAMS listc for when the file might or might not be present.

Use IF LASTCC and MAXCC as needed to control the flow.

Doug

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


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-14 Thread Quasar Chunawalla
Hi,

Well, at my shop they'd use the old IEBPTPCH - the print and punch utility to 
check if there's data in the file.

Sets a RC=04, I Believe if the dataset happens to be empty.

Thank you very much,
Quasar Chunawala

Sent on my BlackBerry® from Vodafone

-Original Message-
From: Ed Gould ps2...@yahoo.com
Sender: IBM Mainframe Discussion List IBM-MAIN@bama.ua.edu
Date: Thu, 14 Jul 2011 10:19:52 
To: IBM-MAIN@bama.ua.edu
Reply-To: IBM Mainframe Discussion List IBM-MAIN@bama.ua.edu
Subject: Re: How to control in an JCL that a file is empty or not exist ?

John,

It depends. Iefbr14 itself does not open close the data set so no EOF is 
written, except if it's a SMS dataset AND the right parameter in IGDSMSxx 
parmlib member.

Ed

Sent from my iPad

On Jul 14, 2011, at 8:01 AM, McKown, John john.mck...@healthmarkets.com 
wrote:

 You say in JCL. The only way that I can think of, off hand, is to run an 
 IEFBR14 step at the beginning of the job similar to:
 
 //STEP0001 EXEC PGM=IEFBR14
 //DD1 DD DSN=first.file,DISP=(MOD,CATLG),
 // UNIT=SYSDA,SPACE=(TRK,1),
 // DCB=(...dcb parameters,DSORG=PS)
 //DD2 DD DSN=second.file,DISP=(MOD,CATLG),
 // UNIT=SYSDA,SPACE=(TRK,1),
 // DCB=(...dcb parameters,DSORG=PS)
 
 As I understand it anymore, if the dataset does not exist, this will allocate 
 it, catalog it, AND write an EOF record on it. If the dataset already exists, 
 it just allocates it, but does nothing else. The writing of the EOF record 
 for a new allocation may require that the dataset be SMS managed. I forget if 
 that is still a requirement. We do this all the time here. 
 
 --
 John McKown 
 Systems Engineer IV
 IT
 
 Administrative Services Group
 
 HealthMarkets(r)
 
 9151 Boulevard 26 * N. Richland Hills * TX 76010
 (817) 255-3225 phone * 
 john.mck...@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
 
 -Original Message-
 From: IBM Mainframe Discussion List 
 [mailto:IBM-MAIN@bama.ua.edu] On Behalf Of Hilario G.
 Sent: Thursday, July 14, 2011 7:40 AM
 To: IBM-MAIN@bama.ua.edu
 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. 
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
 Search the archives at http://bama.ua.edu/archives/ibm-main.html
 
 
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
 Search the archives at http://bama.ua.edu/archives/ibm-main.html

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

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


Re: How to control in an JCL that a file is empty or not exist ?

2011-07-14 Thread Ed Gould
That is NOT necessarily true. I will try and make a long story short.
In the nine or so years I was at one company that managed to (at least once a 
year) to end up getting someone else's data (to be precise another jobs data) 
in a so called empty data set. Yes that's right same lrecl, granted a lot of 
the Datasets had the same lrecl has other Datasets. I would receive a phone 
call in the middle of the night telling me the system was Fu@@'d up and I 
needed to come down and fix it. The first few times I went down and did problem 
determination and found bad data in the file from yesterday's runs. After a few 
times I would get the call and immediately call the VP and explain what was 
going on so he didn't get rudely called down (like I was). 

I repeatedly wrote memo's explaining what had happened and what had to be done 
(major rewrite of production JCL) estimated cost of JCL to convert to SMS so 
the system would write the EOF at deallocation time. I made the case for SMS on 
that alone.

Ed

Sent from my iPad

On Jul 14, 2011, at 9:15 PM, Quasar Chunawalla quasar.chunawa...@gmail.com 
wrote:

 Hi,
 
 Well, at my shop they'd use the old IEBPTPCH - the print and punch utility to 
 check if there's data in the file.
 
 Sets a RC=04, I Believe if the dataset happens to be empty.
 
 Thank you very much,
 Quasar Chunawala
 
 Sent on my BlackBerry® from Vodafone
 
 -Original Message-
 From: Ed Gould ps2...@yahoo.com
 Sender: IBM Mainframe Discussion List IBM-MAIN@bama.ua.edu
 Date: Thu, 14 Jul 2011 10:19:52 
 To: IBM-MAIN@bama.ua.edu
 Reply-To: IBM Mainframe Discussion List IBM-MAIN@bama.ua.edu
 Subject: Re: How to control in an JCL that a file is empty or not exist ?
 
 John,
 
 It depends. Iefbr14 itself does not open close the data set so no EOF is 
 written, except if it's a SMS dataset AND the right parameter in IGDSMSxx 
 parmlib member.
 
 Ed
 
 Sent from my iPad
 
 On Jul 14, 2011, at 8:01 AM, McKown, John john.mck...@healthmarkets.com 
 wrote:
 
 You say in JCL. The only way that I can think of, off hand, is to run an 
 IEFBR14 step at the beginning of the job similar to:
 
 //STEP0001 EXEC PGM=IEFBR14
 //DD1 DD DSN=first.file,DISP=(MOD,CATLG),
 // UNIT=SYSDA,SPACE=(TRK,1),
 // DCB=(...dcb parameters,DSORG=PS)
 //DD2 DD DSN=second.file,DISP=(MOD,CATLG),
 // UNIT=SYSDA,SPACE=(TRK,1),
 // DCB=(...dcb parameters,DSORG=PS)
 
 As I understand it anymore, if the dataset does not exist, this will 
 allocate it, catalog it, AND write an EOF record on it. If the dataset 
 already exists, it just allocates it, but does nothing else. The writing of 
 the EOF record for a new allocation may require that the dataset be SMS 
 managed. I forget if that is still a requirement. We do this all the time 
 here. 
 
 --
 John McKown 
 Systems Engineer IV
 IT
 
 Administrative Services Group
 
 HealthMarkets(r)
 
 9151 Boulevard 26 * N. Richland Hills * TX 76010
 (817) 255-3225 phone * 
 john.mck...@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
 
 -Original Message-
 From: IBM Mainframe Discussion List 
 [mailto:IBM-MAIN@bama.ua.edu] On Behalf Of Hilario G.
 Sent: Thursday, July 14, 2011 7:40 AM
 To: IBM-MAIN@bama.ua.edu
 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. 
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
 Search the archives at http://bama.ua.edu/archives/ibm-main.html
 
 
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
 Search the archives at http://bama.ua.edu/archives/ibm-main.html
 
 --
 For IBM-MAIN subscribe / signoff / archive access instructions,
 send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
 Search the archives at http://bama.ua.edu/archives/ibm-main.html