Tue, 02/16/2010 – 19:53
#1
change data in half file
I have a scenario where we have a huge mainframe file with millions of records. Now I have to change value in one field in half the records. To explain Sample Input fileÂ
001-OLDTEXT-CITY0
001-OLDTEXT-CITY0
:
:
:
001-OLDTEXT-CITY1
001-OLDTEXT-CITY1
001-OLDTEXT-CITY1
001-OLDTEXT-CITY1
001-OLDTEXT-CITY1
001-OLDTEXT-CITY1
:
:
: 10,000 records
001-OLDTEXT-CITY2
001-OLDTEXT-CITY2
Now I wish to change OLDTEXT to NEWTEXT for half the records for CITY1, so after the change
the output file should have 5,000 records for CITY1 with OLDTEXT and another 5,000 with NEWTEXT.
I have both the options available either using SORT or fileaid. But I want to use a quicker and effective way.
Click the +1 button  below to share it with your friends and colleagues
Share this if you liked it!
Disclaimer