Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts INVALID RECFM FOR DDNAME SYSLIN AND C... sandeep kumar302 All Other Mainframe Topics 7 Fri Apr 27, 2018 6:07 pm
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Repeat Sequence Number Until change i... rahulabvp DFSORT/ICETOOL 6 Thu Mar 29, 2018 12:51 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us