View previous topic :: View next topic
|
Author |
Message |
praveenpurushottam
New User
Joined: 11 Sep 2006 Posts: 1
|
|
|
|
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 |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
shyam_shagam
New User
Joined: 07 Sep 2006 Posts: 15 Location: india
|
|
|
|
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 |
|
|
|