IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to identify if file has a record ?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
itzDeepak

New User


Joined: 06 Sep 2005
Posts: 12

PostPosted: Tue Sep 06, 2005 4:28 pm
Reply with quote

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 .. icon_eek.gif
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Tue Sep 06, 2005 5:21 pm
Reply with quote

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
View user's profile Send private message
itzDeepak

New User


Joined: 06 Sep 2005
Posts: 12

PostPosted: Tue Sep 06, 2005 5:57 pm
Reply with quote

Thanks.. icon_biggrin.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top