Posted: Tue Jun 09, 2009 9:57 am Post subject: Using FINDREP, limit to a field
100-byte rec, 1st 20 bytes is a name (text) field. Need to replace "&" with "&" (XML), but shift only the text to the right of "&", and inside the 20 bytes, truncating if necessary; i.e., leave the rest of the record alone.
E.g.,
Code:
Input:
----*----1----*----2----*----3----*----4----*----5----*----6----*----7--...
Black & Decker Hello World!!!
Spic & Span CleanrsHow U Doin?!
Output:
----*----1----*----2----*----3----*----4----*----5----*----6----*----7--...
Black & Decker Hello World!!!
Spic & Span CleHow U Doin?!
thanks, callanand - or should I say "callan&" - but we don't have file-aid in our shop.
anyways, i did a workaround - basically created a 2nd file with just the 20-byte name field, did the FINDREP there, then superimposed it back into the original file - but if a cleaner, more solution is available, I'm all ears.
BLACK & DECKER HELLO WORLD!!!
SPIC & SPAN CLEHOW U DOIN?!
Callanand,
Did you test that solution? You are not limiting your scan criteria to the first 19 bytes and if your job will replace the contents of & found anywhere in the record. Moreover EDITALL shifts the data to the right and the LRECL is increased overall but does not truncate records at the end. Test your solutions before posting and see if you get the right results. _________________ Kolusu
www.linkedin.com/in/kolusu
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum