Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Reading mainframe job spool while the job is running

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Reading mainframe job spool while the job is running
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

Senior Member


Joined: 21 Sep 2010
Posts: 2244
Location: NY,USA

PostPosted: Wed Jan 09, 2019 10:49 am    Post subject:
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.
https://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: 8784
Location: Welsh Wales

PostPosted: Wed Jan 09, 2019 12:56 pm    Post subject:
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 User


Joined: 01 Sep 2015
Posts: 309
Location: Denmark

PostPosted: Wed Jan 09, 2019 3:32 pm    Post subject:
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    Post subject:
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    Post subject:
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: 2221
Location: Hampshire, UK

PostPosted: Mon Jan 21, 2019 2:19 pm    Post subject: Reply to: Reading mainframe job spool while the job is running
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 User


Joined: 01 Sep 2015
Posts: 309
Location: Denmark

PostPosted: Mon Jan 21, 2019 3:11 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SPOOL commands for INTRDR varQon CICS 8 Sat Jul 27, 2019 1:05 am
No new posts Mainframe - PL1, JCL, DB2 opening - 5... Rathish123 Mainframe Jobs 0 Tue Jul 16, 2019 8:13 pm
No new posts The oldest active mainframe developer? John Poulakos General Talk & Fun Stuff 5 Fri Jun 14, 2019 9:24 pm
No new posts Mainframe to linux file count mismatch shreya19 All Other Mainframe Topics 4 Thu Jun 13, 2019 9:49 pm
No new posts Mainframe openings in US /Malaysia Ba... shalini_devi Mainframe Jobs 0 Mon May 20, 2019 7:07 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us