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

No of job count for an milestone job


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sen_1983us

New User


Joined: 21 May 2005
Posts: 21
Location: Hyderabad

PostPosted: Tue Jul 02, 2019 7:34 am
Reply with quote

How to fetch no of predecessor jobs for an milestones job thru rexx
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Tue Jul 02, 2019 10:36 am
Reply with quote

Search all jobs for successor milestones job.
Back to top
View user's profile Send private message
sen_1983us

New User


Joined: 21 May 2005
Posts: 21
Location: Hyderabad

PostPosted: Tue Jul 02, 2019 11:15 am
Reply with quote

This request is to get interim updates when batch is running , we need to get count of jobs to reach milestone job

Ex Morning 9AM 100 jobs to reach milestone job
At 10 AM there will be 50 jobs to reach milestone job

This need to run in automated script
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Tue Jul 02, 2019 11:23 am
Reply with quote

Define a milestone job, and also please explain why this number is so important to someone. It sounds like a requirement for the sake of being required to me.

Any reason that it must be REXX rather than anything else
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Tue Jul 02, 2019 1:24 pm
Reply with quote

You can do the equivalent of SDSF ST in REXX by using the SDSF REXX API. and then count the jobs in their various states. See the manual 'SDSF User's Guide' chapter 'Using SDSF with the REXX programming language' for details. Or search this forum, I'm sure the API has been discussed here.
Though I would think that this exercise could be done better in the / a scheduler?
Back to top
View user's profile Send private message
sen_1983us

New User


Joined: 21 May 2005
Posts: 21
Location: Hyderabad

PostPosted: Tue Jul 02, 2019 4:24 pm
Reply with quote

Im looking script so that we can get get interim status for milestones jobs as part of batch monitoring so that this can be used as dashboard

Also this can this done by any tools?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


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

PostPosted: Tue Jul 02, 2019 6:40 pm
Reply with quote

Still do not know what "milestone job" is. If you are using a scheduler - and with that number of dependencies you should be - your scheduler should be able to provide a list of incomplete pre-req jobs and their status - running, broken, waiting, etc. There may even be a Rexx interface allowing you to pull the reports and process them to provide what you want in the format that you want. So ask your scheduling group and/or the software support person(s) for the scheduler.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 712
Location: Denmark

PostPosted: Tue Jul 02, 2019 9:25 pm
Reply with quote

Ok, here is a REXX sample of mine.

Code:
 /*                                                      REXX               
   Do SDSF STatus                                                           
   Lst each entry with rc, read-, start- and endtime                       
 */                                                                         
                                                                           
 zz=isfcalls('ON')                                                         
 isfprefix=userid()   /* <- jobname/prefix */                               
 Address  SDSF "ISFEXEC  ST (delayed)"                                     
 if rc<>0 then exit msgrtn(rc)  /*  List  any  error  messages  */         
                                                                           
 say 'Jobname  Job-id   Queue     Retcode ',                               
     'Date-time-read      Date-time-start     Date-time-end'               
 do jn=1 to jname.0 /* Loop for all rows returned */                       
   say l8(JNAME.jn) l8(jobid.jn) left(queue.jn,9),                         
       l8(retcode.jn,0),                                                   
       fdt(dater.jn,timer.jn) fdt(datee.jn,timee.jn) fdt(daten.jn,timen.jn)
 end                                                                       
 exit 0                                                                     
                                                                           
l8: return left(arg(1),8)                                                   
 l8r=''                                                                     
 do l8n=1 to words(arg(1))                                                 
   l8r=l8r left(word(arg(1),l8n),8)                                         
 end                                                                       
 return l8r                                                                 
                                                                           
FDT:                                                                       
trace off                                                                   
 arg fdtd,fdtt                                                             
 if fdtd<>'' then do                                                       
   fdtd=date('b',left(fdtd,4)'0101','s')                                   
   fdtd=date('s',fdtd+right(fdtd,3),'b')                                   
   fdtd=nicedate(fdtd)                                                     
 end                                                                       
 else fdtd=copies(' ',10)                                                   
 return fdtd left(fdtt,8)                                                   
                                                                           
NiceDate: return Insert('-',Insert('-',word(arg(1) date('s'),1),6),4)       
                                                                           
msgrtn:  procedure  expose  isfmsg  isfmsg2.                               
 say 'sdsf rc:' arg(1)                                                     
 if  isfmsg<>""  then  Say  "isfmsg  is:"  isfmsg                           
 do  ix=1  to  isfmsg2.0                                                   
   Say  "isfmsg2."ix  "is:"  isfmsg2.ix                                     
 end                                                                       
 return 0                                                                   


The manual 'SDSF User's Guide' chapter 'Using SDSF with the REXX programming language' has a number of samples. Please read that chapter, try the samples and then ask if it does not work.
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Count the number of characters in a f... CA Products 1
Search our Forums:

Back to Top