MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Check for DS %Used in JCL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Mon Mar 08, 2004 10:28 am    Post subject: Check for DS %Used in JCL Reply with quote

A Step in a JCL creates a GDG version (VB , Lrecl 11004).
How can I implement something as follows after the step ???
If GDG-ver %Used > 0
TSO SE 'Records created' U(TESTID)
End-if
Basically a User should be notified automatically in someway that records were created , without having to check the Job output .
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12366
Topics: 75
Location: San Jose

PostPosted: Mon Mar 08, 2004 10:49 am    Post subject: Reply with quote

Vini,

If I understand correctly , you want to send a message to the user if the file has atleast 1 record. You can use one of the methods shown in the link below to check for an empty file and use the retun code to send the message.

http://www.mvsforums.com/helpboards/viewtopic.php?t=1285&highlight=empty

for ex: if you used idcams to check for the empty file , then the next step will run only when there are records in the file.


Code:

//*********************************************************************
//*  SETS RC=0000 IF DATASET HAS RECORDS                              *
//*  SETS RC=0004 IF DATASET IS EMPTY                                 *
//*********************************************************************
//EMPTY    EXEC PGM=IDCAMS                                             
//SYSPRINT DD SYSOUT=*                                                 
//FILE01   DD DSN=YOUR FILE IN QUESTION,                               
//            DISP=SHR                                                 
//SYSIN    DD  *                                                       
   PRINT INFILE(FILE01) CHARACTER COUNT(1)                             
//*                                                                   
//SENDMESG EXEC PGM=IKJEFT01,COND=(4,EQ,EMPTY)                         
//SYSTSPRT DD  SYSOUT=*                                               
//SYSTSIN  DD  *                                                       
 SE 'RECORDS CREATED' U(USERID)                                       
/*


Hope this helps...

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Wed Mar 17, 2004 6:55 pm    Post subject: Reply with quote

Kolusu, Can I use these Steps ,as the Last two steps if I make them a part of the same JCL in which the File is created ?!
My concern is , would the Record count be available in the same JCL after the Step in which the file is created. I want to confirm this , vaguely remember coming across some Posts where these things seemed to be a concern (maybe in a different context though).
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12366
Topics: 75
Location: San Jose

PostPosted: Thu Mar 18, 2004 6:36 am    Post subject: Reply with quote

Vini,

Yes you can use these steps as the last steps of same job which creates the dataset. Make sure to give (+1) version for the last step also. check this topic which explain more about using newly created gdg version in the same job.

http://www.mvsforums.com/helpboards/viewtopic.php?t=1251

Hope this helps...

Cheers

Kolusu
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Thu Mar 18, 2004 1:28 pm    Post subject: Reply with quote

If I understand correctly, it means the GDG gets catalogued soon after the last successfully executed step of the JCL.
kolusu , thanks , got no more confusions ! Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group