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
 

 

SEQNUM with, only, break on key

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

New User


Joined: 25 Jan 2007
Posts: 32
Location: france

PostPosted: Fri Nov 15, 2013 5:03 pm    Post subject: SEQNUM with, only, break on key
Reply with quote

Hello,

I can not process my file as I wish. Can anyone, please, help me ?
It is a fixed length file RECFM=FB, LRECL=80 whose structure is as follows :

Quote:
A_Key AA
various data
various data
...
A_Key BB
various data
various data
...
A_Key CC
various data
various data


The expected result file is as follows :

Quote:
005 A_Key AA
005 various data
005 various data
005 ...
010 A_Key BB
010 various data
010 various data
010 ...

015 A_Key CC

015 various data
015 various data[/code]

The goal is to group records under the key then insert before each group of records a counter whose initial value is 5 and the increment is 5 with a break on the key.

(WHEN-GROUP) to group records works perfectly.
But I do not go out with SEQNUM and then break on the key.

Do you have any idea ?
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri Nov 15, 2013 5:44 pm    Post subject:
Reply with quote

You need to PUSH ID instead of SEQ
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Nov 15, 2013 6:30 pm    Post subject: Reply to: SEQNUM with, only, break on key
Reply with quote

In addition, your IDs will b 1,2,3,4,5.... instead of 5,10,15,20,25....

Use IFTHEN=(WHEN=INIT after the WHEN=GROUP to multiply the ID that GROUP put there by five.
Back to top
View user's profile Send private message
tuxama

New User


Joined: 25 Jan 2007
Posts: 32
Location: france

PostPosted: Fri Nov 15, 2013 7:17 pm    Post subject: Reply to: SEQNUM with, only, break on key
Reply with quote

Thanks for your help. It works with this :

Code:

//S01      EXEC PGM=ICETOOL         
//TOOLMSG  DD SYSOUT=*             
//DFSMSG   DD SYSOUT=*             
//IN       DD *                     
THIS_IS_KEY AA                     
AAAAAAAAAAAAAAAAAAAAAAA             
BBBBBBBBBBBBBBBBBBBBBBB             
CCCCCCCCCCCCCCCCCCCCCCC             
THIS_IS_KEY BB                     
DDDDDDDDDDDDDDDDDDDDDDD             
EEEEEEEEEEEEEEEEEEEEEEE             
FFFFFFFFFFFFFFFFFFFFFFF             
THIS_IS_KEY CC                     
GGGGGGGGGGGGGGGGGGGGGGG             
HHHHHHHHHHHHHHHHHHHHHHH             
IIIIIIIIIIIIIIIIIIIIIII             
/*                                 
//OUT      DD SYSOUT=*             
//TOOLIN   DD *                     
COPY FROM(IN) TO(OUT) USING(CTL1)   
/*                                                                     
//CTL1CNTL DD *                                                         
 INREC IFOUTLEN=200,
  IFTHEN=(WHEN=GROUP,BEGIN=(1,9,CH,EQ,C'THIS_IS_KEY'),PUSH=(30:1,14)),
  IFTHEN=(WHEN=INIT,OVERLAY=(50:SEQNUM,7,ZD,RESTART=(30,14))),
  IFTHEN=(WHEN=GROUP,BEGIN=(50,7,ZD,EQ,1),PUSH=(60:ID=7))
  IFTHEN=(WHEN=INIT,BUILD=60,7,ZD,MUL,+5,1X,1,23))             
/*


Before the last IFTHEN=(WHEN=INIT
Code:

---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* TOP OF DATA *********************************
THIS_IS_KEY AA               THIS_IS_KEY AA      0000001   0000001             
AAAAAAAAAAAAAAAAAAAAAAA      THIS_IS_KEY AA      0000002   0000001             
BBBBBBBBBBBBBBBBBBBBBBB      THIS_IS_KEY AA      0000003   0000001             
CCCCCCCCCCCCCCCCCCCCCCC      THIS_IS_KEY AA      0000004   0000001             
THIS_IS_KEY BB               THIS_IS_KEY BB      0000001   0000002             
DDDDDDDDDDDDDDDDDDDDDDD      THIS_IS_KEY BB      0000002   0000002             
EEEEEEEEEEEEEEEEEEEEEEE      THIS_IS_KEY BB      0000003   0000002             
FFFFFFFFFFFFFFFFFFFFFFF      THIS_IS_KEY BB      0000004   0000002             
THIS_IS_KEY CC               THIS_IS_KEY CC      0000001   0000003             
GGGGGGGGGGGGGGGGGGGGGGG      THIS_IS_KEY CC      0000002   0000003             
HHHHHHHHHHHHHHHHHHHHHHH      THIS_IS_KEY CC      0000003   0000003             
IIIIIIIIIIIIIIIIIIIIIII      THIS_IS_KEY CC      0000004   0000003             
******************************** BOTTOM OF DATA *******************************


And finally the result is :
Code:

---+----1----+----2----+----3----+----4----+----5----+----6
********************************* TOP OF DATA *************
              5  THIS_IS_KEY AA                           
              5  AAAAAAAAAAAAAAAAAAAAAAA                   
              5  BBBBBBBBBBBBBBBBBBBBBBB                   
              5  CCCCCCCCCCCCCCCCCCCCCCC                   
             10  THIS_IS_KEY BB                           
             10  DDDDDDDDDDDDDDDDDDDDDDD                   
             10  EEEEEEEEEEEEEEEEEEEEEEE                   
             10  FFFFFFFFFFFFFFFFFFFFFFF                   
             15  THIS_IS_KEY CC                           
             15  GGGGGGGGGGGGGGGGGGGGGGG                   
             15  HHHHHHHHHHHHHHHHHHHHHHH                   
             15  IIIIIIIIIIIIIIIIIIIIIII                   
******************************** BOTTOM OF DATA ***********


Is there a less complicated way to do this ?
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri Nov 15, 2013 7:29 pm    Post subject:
Reply with quote

Try this

Code:
//CTL1CNTL DD *
 INREC IFOUTLEN=200,
  IFTHEN=(WHEN=GROUP,BEGIN=(1,9,CH,EQ,C'THIS_IS_KEY'),PUSH=(60:ID=7)),
  IFTHEN=(WHEN=INIT,BUILD=(60,7,ZD,MUL,+5,1X,1,23))
/*
Back to top
View user's profile Send private message
tuxama

New User


Joined: 25 Jan 2007
Posts: 32
Location: france

PostPosted: Fri Nov 15, 2013 7:45 pm    Post subject: Reply to: SEQNUM with, only, break on key (Close)
Reply with quote

Perfect it is much better.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Nov 15, 2013 8:10 pm    Post subject: Reply to: SEQNUM with, only, break on key
Reply with quote

tuxama,

Do you really need a 16 byte sequence number? Also why do you have IFOUTLEN=200 when you are only creating just 40 bytes of data?
Back to top
View user's profile Send private message
tuxama

New User


Joined: 25 Jan 2007
Posts: 32
Location: france

PostPosted: Fri Nov 15, 2013 9:25 pm    Post subject: Reply to: SEQNUM with, only, break on key
Reply with quote

No. I made some errors in transcription because the file presented here is an example and is not the one containing the data of my company.

And the correct code should be :
Code:

//TOOLIN   DD *                                     
COPY FROM(IN) TO(OUT) USING(CTL1)                   
/*                                                   
//CTL1CNTL DD *                                     
 INREC IFTHEN=(WHEN=GROUP,                           
               BEGIN=(1,11,CH,EQ,C'THIS_IS_KEY'),   
               PUSH=(30:ID=3)),                     
 IFTHEN=(WHEN=INIT,                                 
         BUILD=(30,3,ZD,MUL,+5,M11,LENGTH=3,         
                1X,                                 
                1,23,                               
                30:X))                               


for this result :

Code:

---+----1----+----2----+----3----+----4----+----5-
********************************* TOP OF DATA ****
005 THIS_IS_KEY AA                               
005 AAAAAAAAAAAAAAAAAAAAAAA                       
005 BBBBBBBBBBBBBBBBBBBBBBB                       
005 CCCCCCCCCCCCCCCCCCCCCCC                       
010 THIS_IS_KEY BB                               
010 DDDDDDDDDDDDDDDDDDDDDDD                       
010 EEEEEEEEEEEEEEEEEEEEEEE                       
010 FFFFFFFFFFFFFFFFFFFFFFF                       
015 THIS_IS_KEY CC                               
015 GGGGGGGGGGGGGGGGGGGGGGG                       
015 HHHHHHHHHHHHHHHHHHHHHHH                       
015 IIIIIIIIIIIIIIIIIIIIIII                       
******************************** BOTTOM OF DATA **
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Nov 15, 2013 10:55 pm    Post subject:
Reply with quote

tuxama,

So now you just 3 byte sequence field? What happens if you have more than 199 Groups? Since you are incrementing the sequence in multiples of 5 what will you do after you have reached 995 as sequence number? 199 groups will end with 995 as sequence number so what will the 200th group have as sequence number?
Back to top
View user's profile Send private message
tuxama

New User


Joined: 25 Jan 2007
Posts: 32
Location: france

PostPosted: Wed Nov 20, 2013 4:15 pm    Post subject: Reply to: SEQNUM with, only, break on key
Reply with quote

Hi Skolusu,

That's right.
But my case can not have more than 5 groups.
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 Appending previous record SEQNUM valu... selvamsrinivasan85 DFSORT/ICETOOL 6 Fri Oct 16, 2015 2:09 pm
No new posts SEQNUM and RESTART zh_lad DFSORT/ICETOOL 2 Tue Aug 25, 2015 8:17 pm
No new posts DISPLAY FROM(.... No page Break knobi DFSORT/ICETOOL 3 Fri Jul 04, 2014 8:13 am
No new posts GDG gens missed when they are remotel... harisukumaran All Other Mainframe Topics 28 Sat Dec 14, 2013 10:49 am
No new posts Xpeditor: Remote BREAK/ABEND is no lo... Satheeshkumar Compuware & Other Tools 2 Mon Sep 30, 2013 8:43 pm


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