Results 1 to 2 of 2

Thread: COBOL - insert a '0' at the second last place in the account field

  1. #1
    Junior Member
    Join Date
    Jan 2007
    Answers
    1

    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


  2. #2
    Contributing Member
    Join Date
    May 2007
    Answers
    85

    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
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact