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

GROUP of undefined number of lines


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 44
Location: India

PostPosted: Fri Feb 05, 2016 5:15 am
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Feb 05, 2016 12:59 pm
Reply with quote

Have a look at ICETOOL's SELECT operator.
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Fri Feb 05, 2016 4:45 pm
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Feb 05, 2016 5:55 pm
Reply with quote

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
View user's profile Send private message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 44
Location: India

PostPosted: Fri Feb 05, 2016 8:31 pm
Reply with quote

H ikranthikumarb , Bill,

That works great as expected.

Thanks for your and inputs.

Its a new learning for me :-)

Thanks,
Khadhar
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Increase the number of columns in the... IBM Tools 3
No new posts Cobol program with sequence number ra... COBOL Programming 5
Search our Forums:

Back to Top