Posted: Tue May 26, 2009 12:23 pm Post subject: prefix with Zeros
Hi, Generally account number would be of 16 bytes. But in same cases of mine it may have less then 16 also. So in that cases i want to prefix that with zeros like 0001234567891234. If my i/p file has the variable as X(16) how can i prefix with zeros?
Don't any of you read the manuals. Actually, this is not so hard.
how about after moving your value to the PIC x(16), multiply the PIC 9(16) by 1.
regardless of what you move to a PIC X field, after a subsequent move, everything has changed. _________________ Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
and the result is
WS-NUMERIC : 012345
We can use INSPECT to get the count of the variables and then we can move zeros into it.
MOVE ZEROES TO WS-PADD-ACCT
INSPECT IN-ACCT TALLYING WS-CNTR FOR
ALL SPACES, HIGH-VALUES, LOW-VALUES
after this code we need to evaluate the counter and we have to prefix the accounts with zeros depending on counter. But here it will take more time incase of lakhs of records since we are using INSPECT variable.
NUMVAL is worked for this... Great....
Redefines also worked with the MOVE for this. Since we are reading file to get the input accounts its failed there.. NUMVAL we can use while reading the file..
Thanks a lot to everyone..
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