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: 8798
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 All times are GMT + 6 Hours
Forum Index -> HomeWorks & Requests

 


Similar Topics
Topic Forum Replies
No new posts Format data from multiple records usi... SYNCSORT 4
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts Structured Data and Nested Loops via ... COBOL Programming 0
No new posts IBM IMU Utility for Easytrieve Code t... IBM Tools 0
No new posts Alternate key data extracttion COBOL Programming 13
Search our Forums:


Back to Top