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
 

 

Add sequence number and increment it for matched records

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

New User


Joined: 05 Dec 2005
Posts: 79

PostPosted: Fri Dec 21, 2007 12:25 pm    Post subject: Add sequence number and increment it for matched records
Reply with quote

Hi,

My input file is as below.

123456 AAA 1A
123527 AAA 1A
123527 AAA 1A
123527 AAA 1B
123527 AAA 1C
123527 BBB 2A
123527 BBB 2B
123527 CCC 1A

I want the output file as below

1 123456 AAA 1A
1 123527 AAA 1A
2 123527 AAA 1A
3 123527 AAA 1B
1 123527 BBB 2A
2 123527 BBB 2B
1 123527 CCC 1A

If first 10 characters are matched then only I want to increment the seqnum other wise it has to restart

Thank you
Back to top
View user's profile Send private message

krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Dec 21, 2007 1:37 pm    Post subject:
Reply with quote

Prabha

Try this DFSORT solution
Code:
//*******************************************************
//STEP1    EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
123456 AAA 1A                                           
123527 AAA 1A                                           
123527 AAA 1A                                           
123527 AAA 1B                                           
123527 AAA 1C                                           
123527 BBB 2A                                           
123527 BBB 2B                                           
123527 CCC 1A                                           
/*                                                       
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                       
  INREC BUILD=(SEQNUM,1,ZD,RESTART=(1,10),3:1,78)       
/*                                                       
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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts how to mask the phone number kumarinfy DB2 4 Mon Apr 03, 2017 5:23 pm
No new posts what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am


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