Page 1 of 1

Use SORT to change fiel value

PostPosted: Wed Jul 14, 2010 2:14 am
by pmagui
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

Re: Use SORT to change fiel value

PostPosted: Wed Jul 14, 2010 2:20 am
by Frank Yaeger
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

Re: Use SORT to change fiel value

PostPosted: Wed Jul 14, 2010 5:59 pm
by pmagui
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.-