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

Utility to check the data existance in a data-set


IBM Mainframe Forums -> HomeWorks & Requests
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chkiran2

New User


Joined: 24 Jun 2004
Posts: 24
Location: Gurgoan

PostPosted: Tue Jun 29, 2004 9:13 am
Reply with quote

icon_question.gif Hi
I an interview I have faced they asked me to tell the name of the IBM utilty which takes only one input i.e. the data set name (PS) and lets us know whether the data-set is empty or not. They told it is not IEBCOMPR by comparing it with a dummy data-set.

Is there any utility to do this. If so how to use that and also please tell whether the same is applicable to PDS.

Thank you,
Back to top
View user's profile Send private message
imvs

New User


Joined: 12 May 2004
Posts: 33

PostPosted: Tue Jun 29, 2004 12:47 pm
Reply with quote

Its print and punch utility

It sets RC=0000 if data set contains records
It sets RC=0004 if it is empty
example :

Code:

         //STEP1      EXEC PGM=IEBPTPCH         
         //SYSUT1    DD DSN=input daaset
         //                   DISP=SHR               
         //SYSUT2    DD DUMMY                   
         //SYSPRINT DD SYSOUT=*               
         //SYSIN      DD *                       
           PRINT                               
         //*
 


you can also use iDCAMS or ICETOOL to find out empty dataset
Back to top
View user's profile Send private message
chkiran2

New User


Joined: 24 Jun 2004
Posts: 24
Location: Gurgoan

PostPosted: Tue Jun 29, 2004 3:09 pm
Reply with quote

Hi
Thanks for the answer. But I am asked that I should not use SYSUT2 DD at all and also told it is not IDCAMS. For that only one DSN is passed I mean SYSUT1.
Back to top
View user's profile Send private message
imvs

New User


Joined: 12 May 2004
Posts: 33

PostPosted: Tue Jun 29, 2004 3:27 pm
Reply with quote

Code:
//STEP1 EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*               
//DFSMSG    DD SYSOUT=*               
//IN       DD DSN=input file,DISP=SHR
//TOOLIN DD *
  COUNT FROM(IN) EMPTY
//*

RC=0 if data set contains records
Rc=12 if data set is empty
Back to top
View user's profile Send private message
chandana_msc

New User


Joined: 28 Mar 2007
Posts: 7
Location: hyderabad

PostPosted: Fri May 11, 2007 3:22 pm
Reply with quote

Can this utility be used for more than two datasets.If so,how?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri May 11, 2007 3:24 pm
Reply with quote

[code]Can this utility be used for more than two datasets.If so,how?[/quote]
You would have to execute the step for EVERY dataset that you wish to check.
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 -> HomeWorks & Requests

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts REASON 00D70014 in load utility DB2 6
Search our Forums:

Back to Top