How to subtract a particular value through all the records



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

How to subtract a particular value through all the records

Postby coollearner » Wed Jun 08, 2011 3:17 pm

I Have a following file with records
686989
697826
655898
088779
065899
676997
787899
58689
I want to subtract 999 from all the records. Can this be achieved using SORT?
Knowledge is wealth
coollearner
 
Posts: 33
Joined: Thu Jun 03, 2010 3:15 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How to subtract a particular value through all the records

 

Re: How to subtract a particular value through all the recor

Postby Frank Yaeger » Wed Jun 08, 2011 8:40 pm

You can use a DFSORT job like the following:

//S1 EXEC PGM=SORT                                         
//SYSOUT DD SYSOUT=*                                       
//SORTIN DD *                                               
686989                                                     
697826                                                     
655898                                                     
088779                                                     
065899                                                     
676997                                                     
787899                                                     
58689                                                       
//SORTOUT DD SYSOUT=*                                       
//SYSIN DD *                                               
  OPTION COPY                                               
  INREC BUILD=(1,6,UFF,SUB,+999,TO=ZD,LENGTH=6)             
/*


SORTOUT would have:

685990     
696827     
654899     
087780     
064900     
675998     
786900     
057690     


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080
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: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post