Change specific fields in flat file



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

Change specific fields in flat file

Postby vinu78 » Fri Aug 02, 2013 7:05 pm

Hi,

My requirement is to change some of the field values in a fixed length flat file if specific condition is met.

In a Fixed length flat file of 300 bytes, if the first 4 bytes is 'TRK ' and 4 bytes from 9th col pos is 'M ' and 4 bytes from 13th col pos is '0200' and 4 bytes from 17th col pos is '0001', then change the first 4 bytes to SPACES, then have spaces in 4 bytes from 9th col pos, zeroes in 4 bytes from 13th col pos and zeroes in 4 bytes from 17th col pos.

All these mentioned fields are declared as characters.

Is it possible using SORT ? Please help.

Thanks
Vinu
vinu78
 
Posts: 29
Joined: Sat Sep 27, 2008 4:47 am
Has thanked: 0 time
Been thanked: 0 time

Re: Change specific fields in flat file

Postby skolusu » Fri Aug 02, 2013 11:10 pm

vinu78 wrote:Is it possible using SORT ? Please help.Thanks
Vinu



Vinu78,

It is a simple task with a single IFTHEN statement.
//SYSIN   DD *                                 
  OPTION COPY                                   
  INREC IFTHEN=(WHEN=(01,4,CH,EQ,C'TRK ',AND,   
                      09,1,CH,EQ,C'M   ',AND,   
                      13,8,CH,EQ,C'02000001'), 
        OVERLAY=(1:4X,9:4X,13:8C'0'))           
//*   


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
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: Change specific fields in flat file

Postby vinu78 » Wed Aug 07, 2013 3:51 am

Thanks Kolusu. It worked...:-)
vinu78
 
Posts: 29
Joined: Sat Sep 27, 2008 4:47 am
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post