-
Junior Member
COBOL - insert a '0' at the second last place in the account field
Hi,
In COBOL, I want to insert a '0' at the second last place in the account field. My account field is 11 bytes and I need to make it to 12 bytes in order to match certain criteria. How can I do this?
Eg- Suppose my the value of my account field is "AGFF1001002" (11 bytes) and I have to make it 12bytes by adding a '0' just before the digit '2'
Thanks in advance
Regards,
Anamika
-
Contributing Member
Re: COBOL - insert a '0' at the second last place in the account field
Define the account number as an 01 level, with sublevels having the first 11 bytes and the last byte.
Def another 01 level with the same 11 bytes, a X1 VALUE '0', and the last byte.
Move the first var 11 bytes to the second 11 bytes and the first last byte to the last last byte.
By calling in the second 01 level variable, you accomplish what you want.
Simple.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules