Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

GROUP of undefined number of lines

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Khadhar Basha

New User


Joined: 28 Oct 2014
Posts: 37
Location: India

PostPosted: Fri Feb 05, 2016 5:15 am    Post subject: GROUP of undefined number of lines
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Fri Feb 05, 2016 12:59 pm    Post subject: Reply to: GROUP of undefined number of lines
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: 114
Location: Hyderabad

PostPosted: Fri Feb 05, 2016 4:45 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7232

PostPosted: Fri Feb 05, 2016 5:55 pm    Post subject: Reply to: GROUP of undefined number of lines
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: 37
Location: India

PostPosted: Fri Feb 05, 2016 8:31 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Sequence number add in SORT pshongal SYNCSORT 3 Fri Sep 02, 2016 3:32 pm
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us