View previous topic :: View next topic
|
Author |
Message |
SreedharNarala
New User
Joined: 30 Apr 2005 Posts: 2 Location: Bangalore
|
|
|
|
I need to format an input file which is of variable length such that for suppose the input file contains data for many country with the file format as below:
Input file:
First three(3) columns/bytes contain Country Number, like 788,678, etc
and the next eight(8) columns/bytes contains Customer Number, f.e 00123456, 99234567, 12345678 etc
Now my question is,, I want to format this input file in such a way that I want to select Country Number '788' and for this country number see if there are any customers whose customer number starts with '99' like 99234567 and replace this first two column/bytes having '99' with '00', while doing I should not format customer numbers for others countries and the OutPut file should contain data for ALL countries and not just for country '788' alone.
Any help is much appreciated. Thank you |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Please show a good example of your input records with relevent values and what you want the output records to look like.
Also, what is the LRECL of your input file?
Do all of the records contain all of the fields or are there "short records" which are missing some of the fields? |
|
Back to top |
|
|
Hritam
New User
Joined: 27 Jun 2005 Posts: 36 Location: India
|
|
|
|
Hi sreedhar,
You can use the following sort card to solve you issue:
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,4,5:5,5,CHANGE=(5,C'78899',C'78800'),
NOMATCH=(5,5),10)
//*
This will check for 78899 records & then replace it by 78800(as far your requirement) Rest of the records it will keep as it is. |
|
Back to top |
|
|
|