Use SORT to change fiel value



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

Use SORT to change fiel value

Postby pmagui » Wed Jul 14, 2010 2:14 am

Hi,
This is the situation I have the following records( this is only a sample):
********************************* Top of
A344567678892
A768504030382
A112345790302
A987367283473
A274848589271

I need to change the records with value "2" in the last position and change them to a "4".
I do not want to write a new progrma to do this.
Is it possible to change only those values using an outrec statement?

Thank in advance.

Pmagui
pmagui
 
Posts: 7
Joined: Thu Jun 10, 2010 5:28 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Use SORT to change fiel value

Postby Frank Yaeger » Wed Jul 14, 2010 2:20 am

You can use a DFSORT job like the following to do what you asked for:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
A344567678892
A768504030382
A112345790302
A987367283473
A274848589271
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
   OPTION COPY
   OUTREC IFTHEN=(WHEN=(13,1,CH,EQ,C'2'),OVERLAY=(13:C'4'))
/*


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: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Use SORT to change fiel value

Postby pmagui » Wed Jul 14, 2010 5:59 pm

Thank you so much Frank for your answer, I really appreciete your help, it worked exactly as I wanted.
I would definetly read that manual.
Thank you again, You are doing a great job here.
Pmagui.-
pmagui
 
Posts: 7
Joined: Thu Jun 10, 2010 5:28 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post