Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Empty GDG check

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
Susanta

Active User


Joined: 17 Nov 2009
Posts: 118
Location: India

PostPosted: Thu Jun 21, 2012 2:28 pm    Post subject: Empty GDG check
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

Moderator


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

PostPosted: Thu Jun 21, 2012 2:48 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Jun 21, 2012 6:37 pm    Post subject:
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: 118
Location: India

PostPosted: Thu Jun 21, 2012 6:48 pm    Post subject:
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

Site Director


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

PostPosted: Thu Jun 21, 2012 7:48 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 21, 2012 9:53 pm    Post subject:
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

Moderator


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

PostPosted: Thu Jun 21, 2012 10:00 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
This topic is locked: you cannot edit posts or make replies. how to find if file is empty or not. abdulrafi DFSORT/ICETOOL 5 Tue May 17, 2016 4:39 pm
No new posts Syntax to check the first 4 digits of... kshirabdhi DFSORT/ICETOOL 10 Tue May 03, 2016 12:21 pm
No new posts Check special resource availability w... pinimo JCL & VSAM 8 Fri Apr 15, 2016 8:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us