|
View previous topic :: View next topic
|
| Author |
Message |
itzDeepak
New User
Joined: 06 Sep 2005 Posts: 12
|
|
|
|
Hi,,
Can sumone suggest me how i can identify if a file has any records?
I want to try this in JCL without using COBOL pgm ..  |
|
| Back to top |
|
 |
radhakrishnan82
Active User

Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
|
|
Deepak,
You can do it in the following ways:
1.
| Code: |
//STEP0001 EXEC PGM=IDCAMS
//IN DD DSN=thedataset name,...
//SYSPRINT DD SYSOUT=*
//SYSIN DD DATA
PRINT INFILE(IN) COUNT(1)
/* |
RC=0 if file has at least 1 record, otherwise RC=4.
2.
| Code: |
//STEP0001 EXEC PGM=ICETOOL
//IN DD DSN=datasetname,
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD DATA
COUNT FROM(IN) EMPTY
/*
//*
// IF (STEP0001.RC) = 0 THEN
//STEP0002 EXEC PGM=NOTEMPTY
// ELSE
//STEP0003 EXEC PGM=EMPTY
//* |
hope this helps. |
|
| Back to top |
|
 |
itzDeepak
New User
Joined: 06 Sep 2005 Posts: 12
|
|
|
|
Thanks..  |
|
| Back to top |
|
 |
|
|