View previous topic :: View next topic
|
Author |
Message |
chkiran2
New User
Joined: 24 Jun 2004 Posts: 24 Location: Gurgoan
|
|
|
|
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 |
|
|
imvs
New User
Joined: 12 May 2004 Posts: 33
|
|
|
|
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 |
|
|
chkiran2
New User
Joined: 24 Jun 2004 Posts: 24 Location: Gurgoan
|
|
|
|
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 |
|
|
imvs
New User
Joined: 12 May 2004 Posts: 33
|
|
|
|
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 |
|
|
chandana_msc
New User
Joined: 28 Mar 2007 Posts: 7 Location: hyderabad
|
|
|
|
Can this utility be used for more than two datasets.If so,how? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
[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 |
|
|
|