Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
rahulabvp

New User

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

Posted: Thu Mar 29, 2018 12:51 pm    Post subject: Repeat Sequence Number Until change in the Key

Hello,

Below is my requirement.

Input

Output

How can i accomplish this?

expat

Global Moderator

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

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

 rahulabvp wrote: How can i accomplish this?
With a great deal of difficulty if you DO NOT bother to give us any details whatsoever
enrico-sorichetti

Senior Member

Joined: 14 Mar 2007
Posts: 10700
Location: italy

 Posted: Thu Mar 29, 2018 7:41 pm    Post subject: Reply to: Repeat Sequence Number Until change in the Key I beg to disagree ... a group operation starting with AAA can create the proper group sequence number
sergeyken

Active Member

Joined: 29 Apr 2008
Posts: 825
Location: Maryland

Posted: Thu Mar 29, 2018 11:00 pm    Post subject:

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
Rohit Umarjikar

Global Moderator

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

Posted: Fri Mar 30, 2018 12:18 am    Post subject:

 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))
sergeyken

Active Member

Joined: 29 Apr 2008
Posts: 825
Location: Maryland

Posted: Fri Mar 30, 2018 12:41 am    Post subject:

Is this data the only possible input?

What is the role of all Axx, except AAA?
expat

Global Moderator

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

 Posted: Tue Apr 03, 2018 1:41 pm    Post subject: 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.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Populating Date and Sequence numer in... PORYES SYNCSORT 11 Thu Jul 16, 2020 5:01 pm PARSE using REPEAT jerryte DFSORT/ICETOOL 1 Tue Jun 23, 2020 1:58 am Sort to construct single record from ... Deepti_R SYNCSORT 3 Wed Nov 13, 2019 12:14 am count the number of records from diff... janmejay CA Products 4 Mon Mar 25, 2019 11:29 pm Add week number to a file name or rep... tejdeep0274 JCL & VSAM 2 Thu Jan 03, 2019 6:49 am

 © 2003-2020 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us