View previous topic :: View next topic
|
Author |
Message |
jilumudi_manohar
New User
Joined: 27 May 2009 Posts: 11 Location: Hyderabad
|
|
|
|
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 |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
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 |
|
|
jilumudi_manohar
New User
Joined: 27 May 2009 Posts: 11 Location: Hyderabad
|
|
|
|
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 |
|
|
jilumudi_manohar
New User
Joined: 27 May 2009 Posts: 11 Location: Hyderabad
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Have a stem holding the jobnames to be processed and loop through the stem. |
|
Back to top |
|
|
Willy Jensen
Active Member
Joined: 01 Sep 2015 Posts: 712 Location: Denmark
|
|
|
|
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 |
|
|
|