Portal | Manuals | 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: 8763
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: 10562
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 User

Joined: 29 Apr 2008
Posts: 400
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

Senior Member

Joined: 21 Sep 2010
Posts: 2105
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 User

Joined: 29 Apr 2008
Posts: 400
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: 8763
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 Add week number to a file name or rep... tejdeep0274 JCL & VSAM 2 Thu Jan 03, 2019 6:49 am How to count the number of times key ... vnktrrd DFSORT/ICETOOL 14 Thu Nov 15, 2018 9:19 pm Accessing control blocks to retrieve ... menonkiran COBOL Programming 5 Wed Nov 14, 2018 9:08 pm Get line number where cursor is from ... satish.ms10 CLIST & REXX 3 Wed Oct 24, 2018 12:23 am Number of Packages required for stati... manojthokala7 DB2 4 Mon Sep 17, 2018 7:14 pm

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