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
 

 

Need the numseq add 1 when the key change

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Need the numseq add 1 when the key change
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 Moderator


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

PostPosted: Thu Dec 04, 2008 12:29 am    Post subject:
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    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 Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm
No new posts How to change dataset attributes of m... ignich7 JCL & VSAM 3 Thu Jul 21, 2016 9:17 pm
No new posts GDG vsersion number change Raghu navaikulam JCL & VSAM 5 Fri May 27, 2016 4:49 pm
No new posts Change Data Capture Ron Klop DFSORT/ICETOOL 14 Fri Apr 15, 2016 2:56 pm


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