Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Repeat Sequence Number Until change in the Key

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

New User


Joined: 05 May 2010
Posts: 7
Location: Bloomington, IL, USA

PostPosted: Thu Mar 29, 2018 12:51 pm    Post subject: Repeat Sequence Number Until change in the Key
Reply with quote

Hello,

Below is my requirement.

Input
Code:
AAA
AAB
AAC
AAD
AAA
AAB
AAC
AAD
AAA

Output
Code:
AAA001
AAB001
AAC001
AAD001
AAA002
AAB002
AAC002
AAD002
AAA003

How can i accomplish this?
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8723
Location: Welsh Wales

PostPosted: Thu Mar 29, 2018 3:30 pm    Post subject: Re: Repeat Sequence Number Until change in the Key
Reply with quote

rahulabvp wrote:

How can i accomplish this?
With a great deal of difficulty if you DO NOT bother to give us any details whatsoever
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10521
Location: italy

PostPosted: Thu Mar 29, 2018 7:41 pm    Post subject: Reply to: Repeat Sequence Number Until change in the Key
Reply with quote

I beg to disagree ...
a group operation starting with AAA can create the proper group sequence number
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 365
Location: Maryland

PostPosted: Thu Mar 29, 2018 11:00 pm    Post subject:
Reply with quote

For some reason my post has been deleted...

First of all
Code:
 INREC BUILD=(1,3,SEQNUM,4,ZD)
 SORT FIELDS=(1,3,CH,A),EQUALS
 END

And next
Code:
 INREC IFTHEN=(WHEN=GROUP,
               KEYBEGIN=(1,3),
               PUSH=(8:SEQ=3))
 SORT FIELDS=(4,4,CH,A),EQUALS
 OUTREC BUILD=(1,3,8,3)
 END

If needed can be combined into a single job step with SYNCTOOL/ICETOOL
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 2031
Location: NY,USA

PostPosted: Fri Mar 30, 2018 12:18 am    Post subject:
Reply with quote

Code:
//S1 EXEC PGM=SORT                                       
//SYSOUT DD SYSOUT=*                                     
//SORTOUT DD SYSOUT=*                                   
//SORTIN DD *                                           
AAA                                                     
AAB                                                     
AAC                                                     
AAD                                                     
AAA                                                     
AAB                                                     
AAC                                                     
AAD                                                     
AAA                                                     
//SYSIN DD *                                             
  OPTION COPY                                           
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'AAA'),     
       PUSH=(4:ID=3))                                   
Back to top
View user's profile Send private message
sergeyken

Active User


Joined: 29 Apr 2008
Posts: 365
Location: Maryland

PostPosted: Fri Mar 30, 2018 12:41 am    Post subject:
Reply with quote

Is this data the only possible input?
Code:
AAA                                                     
AAB                                                     
AAC                                                     
AAD                                                     
AAA                                                     
AAB                                                     
AAC                                                     
AAD                                                     
AAA     

What is the role of all Axx, except AAA?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8723
Location: Welsh Wales

PostPosted: Tue Apr 03, 2018 1:41 pm    Post subject:
Reply with quote

I still believe that it would be better and polite of the OP to actually clarify EXACTLY what the rules are from input to output.
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 Number of Packages required for stati... manojthokala7 DB2 4 Mon Sep 17, 2018 7:14 pm
No new posts How to add new LPARs and change exist... Alan Playford All Other Mainframe Topics 0 Thu Aug 23, 2018 5:52 pm
No new posts Add Comma to each record until find t... naveensrimf DFSORT/ICETOOL 6 Sat Jul 28, 2018 12:25 am
No new posts row change timestamp charanmsrit DB2 3 Tue Jul 10, 2018 12:30 pm
No new posts Question about dataset sequence numbe... harisukumaran JCL & VSAM 23 Tue May 29, 2018 9:31 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us