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

Is there any utility which can tell about a set of datasets


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

New User


Joined: 19 Sep 2006
Posts: 46
Location: New Delhi

PostPosted: Tue May 15, 2007 12:43 pm
Reply with quote

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

Global Moderator


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

PostPosted: Tue May 15, 2007 1:50 pm
Reply with quote

If you had read the idcams manual you would know about using LVL instead of ENT
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue May 15, 2007 3:00 pm
Reply with quote

You can always use REXX with LISTDSI or SYSDSN.

O.
Back to top
View user's profile Send private message
bhim_s

New User


Joined: 19 Sep 2006
Posts: 46
Location: New Delhi

PostPosted: Tue May 15, 2007 3:58 pm
Reply with quote

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

Global Moderator


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

PostPosted: Tue May 15, 2007 4:05 pm
Reply with quote

[url]http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/dgt1v403/CCONTENTS[/quote]
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue May 15, 2007 4:19 pm
Reply with quote

Or even icon_redface.gif

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/dgt1v403/CCONTENTS
Back to top
View user's profile Send private message
bhim_s

New User


Joined: 19 Sep 2006
Posts: 46
Location: New Delhi

PostPosted: Tue May 15, 2007 4:42 pm
Reply with quote

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

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Tue May 15, 2007 5:54 pm
Reply with quote

How about eight IDCAMS steps?
Back to top
View user's profile Send private message
bhim_s

New User


Joined: 19 Sep 2006
Posts: 46
Location: New Delhi

PostPosted: Wed May 16, 2007 10:14 am
Reply with quote

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. icon_sad.gif
Back to top
View user's profile Send private message
Devzee

Active Member


Joined: 20 Jan 2007
Posts: 684
Location: Hollywood

PostPosted: Wed May 16, 2007 11:14 am
Reply with quote

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

New User


Joined: 19 Sep 2006
Posts: 46
Location: New Delhi

PostPosted: Wed May 16, 2007 12:05 pm
Reply with quote

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

New User


Joined: 19 Sep 2006
Posts: 46
Location: New Delhi

PostPosted: Thu May 17, 2007 11:17 am
Reply with quote

Any update guys icon_question.gif icon_neutral.gif
Back to top
View user's profile Send private message
bhim_s

New User


Joined: 19 Sep 2006
Posts: 46
Location: New Delhi

PostPosted: Thu May 17, 2007 2:29 pm
Reply with quote

Thanks guys icon_smile.gif i have solved the problem i have used REXX Code instead of CLIST
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 REASON 00D70014 in load utility DB2 6
No new posts ISRSUPC search utility - using high l... TSO/ISPF 2
No new posts Merging 2 datasets into one DFSORT/ICETOOL 1
No new posts PL/I, VB Datasets and the RDW PL/I & Assembler 4
No new posts how to get list of all VSAM/non-VSAM ... JCL & VSAM 13
Search our Forums:

Back to Top