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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 5 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm


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