Check for DS %Used in JCL
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Job Control Language(JCL)

#1: Check for DS %Used in JCL Author: viniLocation: Maryland PostPosted: Mon Mar 08, 2004 10:28 am
    —
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 .

#2:  Author: kolusuLocation: San Jose PostPosted: Mon Mar 08, 2004 10:49 am
    —
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

#3:  Author: viniLocation: Maryland PostPosted: Wed Mar 17, 2004 6:55 pm
    —
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).

#4:  Author: kolusuLocation: San Jose PostPosted: Thu Mar 18, 2004 6:36 am
    —
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

#5:  Author: viniLocation: Maryland PostPosted: Thu Mar 18, 2004 1:28 pm
    —
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



MVSFORUMS.com -> Job Control Language(JCL)


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group