View previous topic :: View next topic
|
Author |
Message |
bhim_s
New User
Joined: 19 Sep 2006 Posts: 46 Location: Australia
|
|
|
|
Hi,
Is there any utility which can tell about a set of datasets existing or not. as i feel, through LISTCAT we can know only about a specific dataset existing or not but my problem is that i am having 8 datasets and i want to check each dataset existing or not on MVS. i have coded the below programs but it's not working as it return 0 only when all the datasets present and returns 4 if any one of them is missing. i want to make a check for all the datasets if any one of them is present send me a mail so that i can take proper action to stop production abend.
Code: |
//JSE10 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT ENT(Z918788.TEST.JBB1)
LISTCAT ENT(Z918788.TEST.JBB2)
LISTCAT ENT(Z918788.TEST.JOB1)
LISTCAT ENT(Z918788.TEST.JOB2)
LISTCAT ENT(Z918788.TEST.JOB3)
LISTCAT ENT(Z918788.TEST.JOB7)
LISTCAT ENT(Z918788.TEST.JOB8)
LISTCAT ENT(Z918788.TEST.JOB9)
/* //*
//******************************************************
//* SEND MAIL IF STEP JSE10 RETRUNS CODE 0 *
//* ****************************************************
// IF (JSE10.RC EQ 0) THEN
//*
//JSE20 EXEC PGM=SYNCGENR
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSUT1 DD DSN=Z918788.TEST.CNTLLIB(JSEMAL1),DISP=SHR
//SYSUT2 DD SYSOUT=(B,SMTP)
//FAIL20 EXEC PGM=STEPFAIL,REGION=2M,COND=(0,EQ,JSE20)
//*
// ENDIF
//* |
Waiting for your early reponse...Thanks
Bhim |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
If you had read the idcams manual you would know about using LVL instead of ENT |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
You can always use REXX with LISTDSI or SYSDSN.
O. |
|
Back to top |
|
|
bhim_s
New User
Joined: 19 Sep 2006 Posts: 46 Location: Australia
|
|
|
|
expat wrote: |
If you had read the idcams manual you would know about using LVL instead of ENT |
i don't have IDCAMS manual i jst know few commands. I will appreciate if you can send me a link for that or if you can guide by modifying some lines in my code. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
[url]http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/dgt1v403/CCONTENTS[/quote] |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
Back to top |
|
|
bhim_s
New User
Joined: 19 Sep 2006 Posts: 46 Location: Australia
|
|
|
|
ofer71 wrote: |
You can always use REXX with LISTDSI or SYSDSN.
O. |
Hi
I have code the program using Clist but i don't have any idea how can I execute that using JCL & how JCL will take value from CLIST pgm. Please suggest. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1050 Location: Richmond, Virginia
|
|
|
|
How about eight IDCAMS steps? |
|
Back to top |
|
|
bhim_s
New User
Joined: 19 Sep 2006 Posts: 46 Location: Australia
|
|
|
|
Phrzby Phil wrote: |
How about eight IDCAMS steps? |
NO, we can't do that.... i discussed the same as you wrote eight steps with my team leader but he said try to do it in jst two steps. |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
If your team lead has design of what needs to be done then implement that method.
Anyways you can do below IDCAMS LISTC:
Code: |
LISTC LVL(Z918788.TEST) HISTORY |
And then go thru the IDCAMS output to check what dataset exists |
|
Back to top |
|
|
bhim_s
New User
Joined: 19 Sep 2006 Posts: 46 Location: Australia
|
|
|
|
Devzee wrote: |
If your team lead has design of what needs to be done then implement that method.
Anyways you can do below IDCAMS LISTC:
Code: |
LISTC LVL(Z918788.TEST) HISTORY |
And then go thru the IDCAMS output to check what dataset exists |
No, he has not designed anything ... he wants me to do it in jst two steps.
i also can not use LVL because there some other datasets are also existing named
Code: |
Z918788.TEST.JBB3
Z918788.TEST.JOB4
Z918788.TEST.JOB5 |
which i do not want to check.
Now I am trying to do it through CLIST. I have coded the following program for that..
Code: |
PROC 0
CONTROL NOMSG
SET VALUE = OK
SET JBB1 = 'Z918788.TEST.JBB1'
SET JBB2 = 'Z918788.TEST.JBB2'
SET JOB1 = 'Z918788.TEST.JOB1'
SET JOB2 = 'Z918788.TEST.JOB2'
SET JOB3 = 'Z918788.TEST.JOB3'
SET JOB7 = 'Z918788.TEST.JOB7'
SET JOB8 = 'Z918788.TEST.JOB8'
SET JOB9 = 'Z918788.TEST.JOB9'
SELECT &VALUE
WHEN (&SYSDSN(&JBB1) | &SYSDSN(&JBB2) +
| &SYSDSN(&JOB1) | &SYSDSN(&JOB2) +
| &SYSDSN(&JOB3) | &SYSDSN(&JOB7) +
| &SYSDSN(&JOB8) | &SYSDSN(&JOB9)) +
DO
WRITE DATASET FOUND
SET RETURN_CODE = 0
WRITE RETURN_CODE &RETURN_CODE
END
OTHERWISE +
DO
WRITE ALL THE LISTED DATASETS HAVE BEEN DELETED FROM MVS
SET RETURN_CODE = 4
WRITE RETURN_CODE &RETURN_CODE
END
END
EXIT CODE(0) |
This program is working fine but i have no idea know how to use it with JCL and how to pass return code(set in code) to JCL
Bhim |
|
Back to top |
|
|
bhim_s
New User
Joined: 19 Sep 2006 Posts: 46 Location: Australia
|
|
Back to top |
|
|
bhim_s
New User
Joined: 19 Sep 2006 Posts: 46 Location: Australia
|
|
|
|
Thanks guys i have solved the problem i have used REXX Code instead of CLIST |
|
Back to top |
|
|
|