Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to identify if a flat file is empty or not in a JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
praveenpurushottam

New User


Joined: 11 Sep 2006
Posts: 1

PostPosted: Mon Sep 11, 2006 9:19 am    Post subject: How to identify if a flat file is empty or not in a JCL
Reply with quote

I have a program which must be executed if the given file is having any record. How I can identify if a file is empty or not in a JCL without using a COBOL program?
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Mon Sep 11, 2006 9:54 am    Post subject: Re: How to identify if a flat file is empty or not in a JCL
Reply with quote

This is one of the questions which have been answered manytimes in the forum.

anyway... pls SEARCH before making new posts...

Here is one such link...
Back to top
View user's profile Send private message
shyam_shagam

New User


Joined: 07 Sep 2006
Posts: 15
Location: india

PostPosted: Mon Sep 11, 2006 6:03 pm    Post subject: Re: How to identify if a flat file is empty or not in a JCL
Reply with quote

praveenpurushottam,

You can insert the following code before executing the program step.

//STEP01R EXEC PGM=IDCAMS RC = 4 IF FILE IS EMPTY
//SYSPRINT DD SYSOUT=*
//IN1 DD DSN=Give your input file,DISP=SHR
//OUT1 DD DUMMY,
// DCB=(RECFM=VB,LRECL=2356)
//SYSIN DD *
REPRO INFILE(IN1) OUTFILE(OUT1) COUNT(1)
/*
//*
//STEP02R EXEC PGM=PROGRAM,COND(4,EQ)
//SYSPRINT DD SYSOUT=*
- - - -- - - -
- - - -- - - -
- - - -- - - -

If the input file for the step is empty....... the next step STEP02 wont execute........

Thanks,
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts COB2 file processing rizwanaccy COBOL Programming 8 Tue Jan 02, 2018 1:00 pm
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
No new posts Preserve order in Input File pshongal DFSORT/ICETOOL 13 Thu Dec 21, 2017 4:20 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us