View previous topic :: View next topic
|
Author |
Message |
Susanta
Active User
Joined: 17 Nov 2009 Posts: 126 Location: India
|
|
|
|
Hi
I need to know if a gdg is empty or not.
Can i use below jcl to compare please help.
Thanks
//JS20 EXEC PGM=IEBCOMPR
//SYSPRINT DD SYSOUT=A
//SYSIN DD DUMMY
//SYSUT1 DD DUMMY
//SYSUT2 DD DSN=XXX.TEST.GDG,DISP=SHR |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Try this
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
//TOOLIN DD *
COUNT FROM(IN) EMPTY |
If Empty it will set RC= 12
If not empty it will set RC=0 |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
are you inquiring about 1 file or all the files associated with a gdg,
because your sysout2 refers to base, which means all files associated with the gdg
and not just one file.
Quote: |
//SYSUT2 DD DSN=XXX.TEST.GDG,DISP=SHR |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I need to know if a gdg is empty or not. |
As DBZ mentioned, you need to explain what this means to you. It might have multiple meanings for those of us who read it.
Quote: |
Can i use below jcl to compare please help. |
I believe not. . . |
|
Back to top |
|
|
Susanta
Active User
Joined: 17 Nov 2009 Posts: 126 Location: India
|
|
|
|
tHANKS ALL. i meant all versions. Pandora's suggestion worked. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
i meant all versions |
Probably NOT.
I suspect you meant generations rather than versions. . . While there is a Version, you will probably never use this. And there is a BIG difference between a generation and a version. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Just a quick point here, but let's assume that the GDG base has 40 generations, and each generation on average holds 1 million records. That means that you will read 40+ million records to find out the answer.
I suggest an alternative less wasteful method be explored. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Thanks for the point Expat
Code: |
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=GDGBASE,DISP=SHR
//TOOLIN DD *
COUNT FROM(IN) EMPTY |
I believe EMPTY just reads only till one record |
|
Back to top |
|
|
|