Adding zeros in a flat fiel using SORT



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Adding zeros in a flat fiel using SORT

Postby raz832 » Thu Jan 21, 2010 3:32 pm

Hi,

I need some guidance on the SORT card.Can we add zeros using SORT card.
The input looks like
11111222223333444444

Output should look like

000022222000000000000

Could you please help me on how can we do this using SORT?
Thanks,
Rajesh.C
raz832
 
Posts: 1
Joined: Thu Jan 21, 2010 2:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Adding zeros in a flat fiel using SORT

Postby Frank Yaeger » Thu Jan 21, 2010 10:45 pm

I'm not sure exactly what you want to do here since your example is rather confusing. But if you want to overlay everything except the 22222 field with character zeros (C'0'=X'F0'), you can do it with a DFSORT job like this:

//S1    EXEC  PGM=SORT                   
//SYSOUT    DD  SYSOUT=*                 
//SORTIN DD *                           
11111222223333444444                     
//SORTOUT DD SYSOUT=*                   
//SYSIN    DD    *                       
  OPTION COPY                           
  INREC OVERLAY=(1:5C'0',11:10C'0')     


SORTOUT would have:

00000222220000000000 


If that's not what you want to do, then you need to explain more clearly what it is you want to do with a good example. Use ubb code tags for the example.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post