View previous topic :: View next topic
Author
Message
Khadhar Basha New User Joined: 28 Oct 2014Posts: 44 Location: India
Hi,
I have a input, where S - TIME is actual job start time E - TIME is job end time.
I need to get the job abended time and fixed time i.e when the first time job abends E - TIME and when finally job gets fixed i.e final run S - TIME. In between a job could have run many times to fix.
I tried to use WHEN=GROUP but since I dont know the exact occurrence of fix time I am confused.
Input :
Code:
JOBNAME , S - DATE , S - TIME , E - DATE , E - TIME ,
AAAAAAAA , 20160201 , 23:03:13 , 20160201 , 23:04:19 ,
AAAAAAAA , 20160201 , 23:37:03 , 20160201 , 23:37:54 ,
BBBBBBBB , 20160201 , 21:09:23 , 20160201 , 21:09:47 ,
BBBBBBBB , 20160201 , 21:15:22 , 20160201 , 21:15:52 ,
BBBBBBBB , 20160201 , 21:18:22 , 20160201 , 21:18:22 ,
CCCCCCCC , 20160201 , 07:55:00 , 20160201 , 07:55:20 ,
CCCCCCCC , 20160201 , 07:58:00 , 20160201 , 07:55:00 ,
DDDDDDDD , 20160201 , 11:51:38 , 20160201 , 11:51:38 ,
DDDDDDDD , 20160201 , 11:54:59 , 20160201 , 11:54:59 ,
DDDDDDDD , 20160201 , 12:25:28 , 20160201 , 12:25:29 ,
DDDDDDDD , 20160201 , 12:26:57 , 20160201 , 12:26:58 ,
DDDDDDDD , 20160201 , 13:01:03 , 20160201 , 13:01:04 ,
DDDDDDDD , 20160201 , 15:02:53 , 20160201 , 15:02:53 ,
DDDDDDDD , 20160201 , 15:32:17 , 20160201 , 15:32:17 ,
DDDDDDDD , 20160201 , 17:03:09 , 20160201 , 17:03:19 ,
OUTPUT:
Code:
AAAAAAAA , 20160201 , 23:04:19 , 20160201 , 23:37:03 ,
BBBBBBBB , 20160201 , 21:09:47 , 20160201 , 21:18:22 ,
cccccccc , 20160201 , 07:55:20 , 20160201 , 07:58:00 ,
DDDDDDDD , 20160201 , 11:51:38 , 20160201 , 17:03:09 ,
Help me in solving this, to get exact job abended time and resolved time.
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
Have a look at ICETOOL's SELECT operator.
Back to top
kranthikumarb Active User Joined: 02 Jan 2009Posts: 115 Location: Hyderabad
You may use this.
Code:
//SORT1 EXEC PGM=ICETOOL
//SORTIN DD *
AAAAAAAA , 20160201 , 23:03:13 , 20160201 , 23:04:19 ,
AAAAAAAA , 20160201 , 23:37:03 , 20160201 , 23:37:54 ,
BBBBBBBB , 20160201 , 21:09:23 , 20160201 , 21:09:47 ,
BBBBBBBB , 20160201 , 21:15:22 , 20160201 , 21:15:52 ,
BBBBBBBB , 20160201 , 21:18:22 , 20160201 , 21:18:22 ,
CCCCCCCC , 20160201 , 07:55:00 , 20160201 , 07:55:20 ,
CCCCCCCC , 20160201 , 07:58:00 , 20160201 , 07:55:00 ,
DDDDDDDD , 20160201 , 11:51:38 , 20160201 , 11:51:38 ,
DDDDDDDD , 20160201 , 11:54:59 , 20160201 , 11:54:59 ,
DDDDDDDD , 20160201 , 12:25:28 , 20160201 , 12:25:29 ,
DDDDDDDD , 20160201 , 12:26:57 , 20160201 , 12:26:58 ,
DDDDDDDD , 20160201 , 13:01:03 , 20160201 , 13:01:04 ,
DDDDDDDD , 20160201 , 15:02:53 , 20160201 , 15:02:53 ,
DDDDDDDD , 20160201 , 15:32:17 , 20160201 , 15:32:17 ,
DDDDDDDD , 20160201 , 17:03:09 , 20160201 , 17:03:19 ,
/*
//SEND DD DSN=&&SEND,UNIT=SYSDA,SPACE=(CYL,(250,100)),
// DISP=(,PASS)
//CATCH DD DSN=*.SEND,DISP=(OLD,PASS),VOL=REF=*.SEND
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD *
COPY FROM(SORTIN) TO(SEND) USING(CTL1)
SELECT FROM(SEND) TO(SORTOUT) ON(1,8,CH) LASTDUP
//*
//CTL1CNTL DD *
INREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,8),PUSH=(55:45,8))
OUTREC BUILD=(1,22,23:55,8,31:31,14,45:23,10,20X)
/*
//SORTOUT DD SYSOUT=*
Back to top
Bill Woodger Moderator Emeritus Joined: 09 Mar 2011Posts: 7309 Location: Inside the Matrix
kranthikumarb,
Yes, that works, but...
Two passes of the data, and a SORT. There is a USING available for SELECT, and your preprocessing can be done there, and you should turn off the SORT (OPTION COPY, or SORT FIELDS=NONE) because the data is already in sequence.
You use OUTREC for your BUILD. Prior to the first IFTHEN=(WHEN=(logicalexpression) you can use IFTHEN=(WHEN=INIT, even after WHEN=GROUP, so you only need INREC. Without the OUTREC, you can use the USING for SELECT.
Using column-numbers in BUILD when the next available position is that column number is unnecessary and confusing.
I'm not sure why you have the 20X, but TS/OP can decide about that.
Code:
//SORT1 EXEC PGM=ICETOOL
//SORTIN DD *
AAAAAAAA , 20160201 , 23:03:13 , 20160201 , 23:04:19 ,
AAAAAAAA , 20160201 , 23:37:03 , 20160201 , 23:37:54 ,
BBBBBBBB , 20160201 , 21:09:23 , 20160201 , 21:09:47 ,
BBBBBBBB , 20160201 , 21:15:22 , 20160201 , 21:15:52 ,
BBBBBBBB , 20160201 , 21:18:22 , 20160201 , 21:18:22 ,
CCCCCCCC , 20160201 , 07:55:00 , 20160201 , 07:55:20 ,
CCCCCCCC , 20160201 , 07:58:00 , 20160201 , 07:55:00 ,
DDDDDDDD , 20160201 , 11:51:38 , 20160201 , 11:51:38 ,
DDDDDDDD , 20160201 , 11:54:59 , 20160201 , 11:54:59 ,
DDDDDDDD , 20160201 , 12:25:28 , 20160201 , 12:25:29 ,
DDDDDDDD , 20160201 , 12:26:57 , 20160201 , 12:26:58 ,
DDDDDDDD , 20160201 , 13:01:03 , 20160201 , 13:01:04 ,
DDDDDDDD , 20160201 , 15:02:53 , 20160201 , 15:02:53 ,
DDDDDDDD , 20160201 , 15:32:17 , 20160201 , 15:32:17 ,
DDDDDDDD , 20160201 , 17:03:09 , 20160201 , 17:03:19 ,
/*
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(SORTIN) TO(SORTOUT) ON(1,8,CH) LASTDUP USING(CTL1)
//*
//CTL1CNTL DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,8),PUSH=(55:45,8)),
IFTHEN=(WHEN=INIT,
BUILD=(1,22,55,8,31,14,23,10,20X))
/*
//SORTOUT DD SYSOUT=*
Back to top
Khadhar Basha New User Joined: 28 Oct 2014Posts: 44 Location: India
H ikranthikumarb , Bill,
That works great as expected.
Thanks for your and inputs.
Its a new learning for me :-)
Thanks,
Khadhar
Back to top
Please enable JavaScript!