View previous topic :: View next topic
|
Author |
Message |
Khadhar Basha
New User
Joined: 28 Oct 2014 Posts: 44 Location: India
|
|
|
|
Hi Everyone,
I am trying to develope a tool in rexx to monitor long running jobs.
I will be submitting a job every 1 hour using FTP process by PSJ thru my desktop schedular.
I just want to extract jobs in execution state and take the jobname and start time.
I have searched forum and found below below code
ibmmainframeforum.com/viewtopic.php?f=31&t=6411
I am unable to capture Start time
Could any one please let me know what is
Isfcols for start and end time.
Thanks
Basha. |
|
Back to top |
|
|
Paul Voyner
New User
Joined: 26 Nov 2012 Posts: 52 Location: UK
|
|
|
|
Type COLSHELP from ST panel to see all available ISFCOLS, or else in the REXX do "say ISFCOLS"
You'll see the columns are called TIMEE and DATEE |
|
Back to top |
|
|
Khadhar Basha
New User
Joined: 28 Oct 2014 Posts: 44 Location: India
|
|
|
|
Hi all,
Thanks for the reply
Below is my code (copied from forum - Enrico's)
/*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
Trace "O"
Parse Source _sys _how _cmd .
parse arg args
IsfRC = isfcalls("ON")
if IsfRC ª= 0 then do
say "isfcalls RC" IsfRC
exit
end
isfprefix = "WR*"
isffilter = "queue = EXECUTION"
/*isfcols = "jname jobid ownerid actsys ISYSID"*/
Address SDSF "isfexec st"
if RC ª= 0 then do
say "isfexec RC" RC
exit
end
do i = 1 to jname.0
say jname.i jobid.i ownerid.i actsys.i jprio.i timee.i
end
call isfcalls "OFF"
exit
Output:
WRJOBBTV S0256914 WRVT RCQ4 15 TIMEE.1
WRMVSTV S0256920 WRMV RCQ4 15 TIMEE.2
WRVFDBTV S0256922 WRVF RCQ4 15 TIMEE.3
But St-time of the job is not getting displayed instead am getting above results.
Please help me in this regard. I want to view the start time and start date. |
|
Back to top |
|
|
Paul Voyner
New User
Joined: 26 Nov 2012 Posts: 52 Location: UK
|
|
|
|
Try Address SDSF "isfexec st (ALTERNATE" |
|
Back to top |
|
|
Khadhar Basha
New User
Joined: 28 Oct 2014 Posts: 44 Location: India
|
|
|
|
Hi paul,
Thanks for the reply.
When I issue COLSHELP
Staright to column st-time delayed? Is marked as X
Would that be a problem. |
|
Back to top |
|
|
Paul Voyner
New User
Joined: 26 Nov 2012 Posts: 52 Location: UK
|
|
|
|
Hi,
Try Address SDSF "isfexec st (ALTERNATE DELAYED" |
|
Back to top |
|
|
Khadhar Basha
New User
Joined: 28 Oct 2014 Posts: 44 Location: India
|
|
|
|
Wow paul
You are a genius. Thanks a lot paul its working. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Khadhar,
In the future, please use the Code tags to indicate actual character spacing:
Code: |
/*REXX - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
Trace "O"
Parse Source _sys _how _cmd .
parse arg args
IsfRC = isfcalls("ON")
if IsfRC ª= 0 then do
say "isfcalls RC" IsfRC
exit
end
isfprefix = "WR*"
isffilter = "queue = EXECUTION"
/*isfcols = "jname jobid ownerid actsys ISYSID"*/
Address SDSF "isfexec st"
if RC ª= 0 then do
say "isfexec RC" RC
exit
end
do i = 1 to jname.0
say jname.i jobid.i ownerid.i actsys.i jprio.i timee.i
end
call isfcalls "OFF"
exit |
|
|
Back to top |
|
|
Khadhar Basha
New User
Joined: 28 Oct 2014 Posts: 44 Location: India
|
|
|
|
Hi Terry,
Thanks I will follow the same in future.
Rexx experts,
Is there any function that compare two date and time and give the difference.
Say i have job start time1 is 15016(julian date) 23:40:30
Job end time is 15017 01:05:30
There would be actually 00:25:00 mins difference.
How could i achieve it. Please help. |
|
Back to top |
|
|
Paul Voyner
New User
Joined: 26 Nov 2012 Posts: 52 Location: UK
|
|
|
|
Khadar, Rexx doesn't give you any functions to do this, so you have to do some coding. Take a look at the following, it converts date and time formats to number of seconds since year 2000. Then you can easily check the difference between 2 different datetime values.
Code: |
/*rexx*/
trace n
d = '15042'
t = '01:23:45'
secs1 = GetSecs(d,t)
d = '15044'
t = '23:22:21'
secs2 = GetSecs(d,t)
say "Difference in seconds between datetime values="secs2 - secs1
return
GetSecs: Procedure
arg d,t
/* Convert year into seconds since 2000*/
yy = left(d,2)
ddd = right(d,3)
leap = trunc(yy/4)
yearsecs = yy*365*24*60*60
/* Add yeap years */
yearsecs = yearsecs+leap*24*60*60
daysecs = ddd*24*60*60
/* Add time */
parse var t hh':'mm':'ss
timesecs= hh*60*60 + mm*60 +ss
return yearsecs+daysecs+timesecs |
|
|
Back to top |
|
|
Khadhar Basha
New User
Joined: 28 Oct 2014 Posts: 44 Location: India
|
|
|
|
Hi Paul,
Thanks a lot for the code. Now am able to extract start time of job as well place current time using TIME() function.
With the above details am using DFSORT to calculate the time.
Got it from below link
ibmmainframes.com/about54109.html
Thanks all for helping me:) |
|
Back to top |
|
|
|