Page 1 of 1

To assign zero to new comp-3 field in existing record

PostPosted: Fri Nov 27, 2009 2:21 pm
by haribabu80
I have introduced a new field in existing file and defined as comp-3. When i give this file has input, it is abended with soc7. Now i want to replace the filed spaces with zeros. Can anyone pls help me?

Then new field start from 380 to 384.

Re: To assign zero to new comp-3 field in existing record

PostPosted: Sat Nov 28, 2009 6:07 am
by Frank Yaeger
To replace spaces in 380-384 with a valid PL5'0' field (COMP-3), you can use these DFSORT statements:

   INREC IFTHEN=(WHEN=(380,5,CH,EQ,C' '),OVERLAY=(380:+0,TO=PD,LENGTH=5))


To replace any non-numeric PD value in 380-384 with a valid PL5'0' field, you can use these DFSORT statements:

   INREC IFTHEN=(WHEN=(380,5,PD,NE,NUM),OVERLAY=(380:+0,TO=PD,LENGTH=5))