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

Reading mainframe job spool while the job is running


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

New User


Joined: 27 May 2009
Posts: 11
Location: Hyderabad

PostPosted: Wed Jan 09, 2019 9:48 am
Reply with quote

Hi ,
Is there a way to read mainframe job spool while the job is running?

My requirement is ,there is an existing job running for 24/7 and my new job should read the existing job's spool and it should alert me if it finds specified messages in the spool.

Thanks,
Manohar
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Wed Jan 09, 2019 10:49 am
Reply with quote

It must be a CICS region job which runs for 24/7 and your new job should also run then for 24/7 to alert you as soon as you get what you looking for , is it ?

At this point see if ISFAFD utility helps or look for any batch sdsf way here.
www.ibm.com/support/libraryserver/BOOKS/ISF1GR00/CCONTENTS?DT=19970129154852

How about getting the output in a dataset instead of spool and then look into it in easy way by dfsort or rexx or cobol program , is it feasible and durable option ?

Don’t forget to check with scheduling team if they have any way to achieve it without much of a change.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Wed Jan 09, 2019 12:56 pm
Reply with quote

Not necessarily a CICS region, there may be other applications that run 24/7, DFhsm for example.

Does your shop have something like NETVIEW or another software package that can do this. From experience I have found that a proprietry package works far more efficiently than anything home grown.

I did once write a REXX that sat there looking for required responses for DASD initialisations, and it was grossly inneficient, but it saved the operators having to monitor the screen and reply "U" 64 times
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Wed Jan 09, 2019 3:32 pm
Reply with quote

This has been discussed a number of times. REXX using the SDSF API can do it like this:
Code:
 n=isfcalls('ON')                                                     
                                                                     
 /* set isfprefix = jobname */                                       
 isfprefix='RMF'                                                     
 say 'Looking for:' isfprefix                                         
 Address  SDSF                                                       
 "ISFEXEC ST"                                                         
 if rc<>0 then call SdsfErr 'ST'                                     
 ap=0                                                                 
 do i=1 to jobid.0                                                   
   if queue.i='EXECUTION' then ap=i                                   
 end                                                                 
 if ap=0 then exit xmsg('Job not found',8)                           
                                                                     
 "ISFACT ST TOKEN('"TOKEN.ap"') PARM(NP SA)"                         
 if rc<>0 then call SdsfErr 'ST NP SA'                               
 do jx=1 to isfddname.0                                               
 /*Say "Dsname" isfddname.jx isfdsname.jx  */                         
   if right(isfdsname.jx,8)='JESMSGLG' then do                       
     say 'read...'                                                   
     address tso "EXECIO * DISKR" isfddname.jx "(STEM line. FINIS)"   
     if rc<>0 then exit xmsg('read rc' rc,8)                         
     Say " Lines read:" line.0                                       
     do kx = 1 to line.0                                             
       Say line.kx                                                   
     end                                                             
   end                                                               
 end                                                                 
 exit xmsg('Ok')                                                     
                                                                     
SdsfErr:                                                             
 say arg(1)':' isfmsg                                                 
 say isfdisplay                                                       
 do  i=1  to  isfmsg2.0                                               
   say isfmsg2.i                                                     
 end                                                                 
 exit 12                                                             
XMsg: if arg(1)<>'' then say arg(1);return word(arg(2) 0,1)           
Back to top
View user's profile Send private message
jilumudi_manohar

New User


Joined: 27 May 2009
Posts: 11
Location: Hyderabad

PostPosted: Thu Jan 10, 2019 4:29 am
Reply with quote

Thanks Rohit and Expat for the replies.
Hi Willy,
I will implement this logic for my requirement and get back to you If I face any issues.

Thanks for the help.

Regards,
Manohar
Back to top
View user's profile Send private message
jilumudi_manohar

New User


Joined: 27 May 2009
Posts: 11
Location: Hyderabad

PostPosted: Mon Jan 21, 2019 10:10 am
Reply with quote

Hi Willy,
The above code is fulfilling my requirement with slight modifications but only for one job. I need this REXX program to look for multiple IMS regions(jobs) and alert me if any of the mentioned region is having an issue. Do you have any idea on how to handle multiple jobs?

Thanks,
Manohar
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Jan 21, 2019 2:19 pm
Reply with quote

Have a stem holding the jobnames to be processed and loop through the stem.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Mon Jan 21, 2019 3:11 pm
Reply with quote

Something like
Code:
 isfprefix='T*'                                                           
 joblist='TCPIP TSO'                                                     
 rc=isfcalls('ON')                                                       
 Address  SDSF                                                           
 "ISFEXEC ST"                                                             
 if rc<>0 then call SdsfErr 'ST'                                         
 do stn=1 to jobid.0                                                     
   say jname.stn queue.stn                                               
   if queue.stn<>'EXECUTION' | wordpos(jname.stn,joblist)=0 then iterate 
   say 'Jobname' jname.stn                                               
   "ISFACT ST TOKEN('"TOKEN.stn"') PARM(NP SA)"                           
   if rc<>0 then call SdsfErr 'ST NP SA'                                 
   do jx=1 to isfddname.0                                                 
     if right(isfdsname.jx,8)='JESMSGLG' then do                         
       say 'read...'                                                     
       address tso "EXECIO * DISKR" isfddname.jx "(STEM line. FINIS)"     
       if rc<>0 then exit xmsg('read rc' rc,8)                           
       do kx = 1 to line.0                                               
         Say line.kx                                                     
       end                                                               
     end                                                                 
   end                                                                   
 end                                                                     

Please refer to the SDSF and REXX manuals for details and further reading.
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 Running REXX through JOB CLIST & REXX 13
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Running a Job with the Default User ID JCL & VSAM 2
Search our Forums:

Back to Top