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 based on record count

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

New User


Joined: 28 Dec 2010
Posts: 25
Location: Chennai

PostPosted: Wed Mar 09, 2011 4:13 pm    Post subject: Add sequence number based on record count
Reply with quote

Hi

My input file is

123
124
125
126
211
233

My o/p file shud be

2331
2112
1263
1251
1242
1233

I am sorting my input file descending and appending sequence num till 3 and after 3 I am starting once again from 1.


Can u tell me how to do it using sort card?


By the way my i/p & o/p card lrec is 80 and FB file.


Thanks
Madhan
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Mar 09, 2011 10:38 pm    Post subject: Reply to: Add sequence number based on record count
Reply with quote

MadanVS,

Use the following DFSORT JCL which will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD *                                     
123                                                 
124                                                 
125                                                 
126                                                 
211                                                 
233                                                 
//SORTOUT  DD SYSOUT=*                               
//SYSIN    DD *                                     
  SORT FIELDS=(1,3,CH,D),EQUALS                     
  OUTREC IFTHEN=(WHEN=GROUP,RECORDS=3,PUSH=(4:SEQ=1))
//*
Back to top
View user's profile Send private message
MadanVS

New User


Joined: 28 Dec 2010
Posts: 25
Location: Chennai

PostPosted: Thu Mar 10, 2011 10:42 am    Post subject: Reply to: Add sequence number based on record count
Reply with quote

Thanks Skolusu.

Its working good.
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 column with count of rows within dist... ronald wouterson DB2 4 Sun Sep 17, 2017 9:48 pm
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am

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