Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to identify if file has a record ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: How to identify if file has a record ?
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: 436
Location: chennai, India

PostPosted: Tue Sep 06, 2005 5:21 pm    Post subject: Re: How to identify if file has a record ?
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    Post subject: Re: How to identify if file has a record ?
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    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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us