IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need the numseq add 1 when the key change


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
elmister

New User


Joined: 27 Nov 2005
Posts: 14

PostPosted: Thu Dec 04, 2008 12:02 am
Reply with quote

hI, I need to do the following:

I have a file with the following key:
AAA
AAA
AAA
BBB
BBB
BBB
CCC
CCC
CCC

and i need an output file with the following:

AAA 001
AAA 001
AAA 001
BBB 002
BBB 002
BBB 002
CCC 003
CCC 003
CCC 003

I need the numseq add 1 when the key change.

Thanks in advance
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Dec 04, 2008 12:29 am
Reply with quote

Here's a DFSORT job that will do what you asked for. It uses DFSORT's new WHEN=GROUP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). If you don't have that PTF, ask your System Programmer to install it (it's free).

Code:

//S1    EXEC  PGM=ICEMAN                                         
//SYSOUT    DD  SYSOUT=*                                         
//SORTIN DD *                                                     
AAA                                                               
AAA                                                               
AAA                                                               
BBB                                                               
BBB                                                               
BBB                                                               
CCC                                                               
CCC                                                               
CCC                                                               
//SORTOUT DD SYSOUT=*                                             
//SYSIN    DD    *                                               
  OPTION COPY                                                     
  INREC IFOUTLEN=80,                                             
    IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,3))),   
    IFTHEN=(WHEN=GROUP,BEGIN=(81,8,ZD,EQ,1),PUSH=(5:ID=3))       
/*
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
No new posts 3270 personal communications. Can't c... TSO/ISPF 2
No new posts SELECT from data change table DB2 5
No new posts Trying to change copybook in online c... CICS 4
No new posts Change Default Scroll Setting TSO/ISPF 1
Search our Forums:

Back to Top