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

Empty GDG check


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Susanta

Active User


Joined: 17 Nov 2009
Posts: 126
Location: India

PostPosted: Thu Jun 21, 2012 2:28 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Jun 21, 2012 2:48 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jun 21, 2012 3:10 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 21, 2012 6:37 pm
Reply with quote

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
View user's profile Send private message
Susanta

Active User


Joined: 17 Nov 2009
Posts: 126
Location: India

PostPosted: Thu Jun 21, 2012 6:48 pm
Reply with quote

tHANKS ALL. i meant all versions. Pandora's suggestion worked.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 21, 2012 7:48 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Thu Jun 21, 2012 9:53 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Jun 21, 2012 10:00 pm
Reply with quote

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
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts How to check whether who renamed the ... JCL & VSAM 3
No new posts No ++JCLIN, APPLY CHECK job JCL & VSAM 1
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
Search our Forums:

Back to Top