About programming in AS/400

335 pts.
Tags:
AS/400
AS/400 programming
I have a field in a file which is of alphanumeric type with a length of 15 and I'm going to store a string in that which is of 11 length and the string will be 'CAS00TST01A'. Now I want to extract the letter which is at 11th position i:e 'A' and i want to convert it to numeric. Could you please let me know which opcode will do this and ,if possible, could you post a sample code by declaring a field which is of alphanumeric type and passing the same value which I mentioned?

Software/Hardware used:
iseries or as400

Answer Wiki

Thanks. We'll let you know when a new response is added.

With a combination of %XLATE and %SUBST you can do this with one instruction.

 

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Until you define what you mean by converting a non-numeric 'A' to some kind of 'numeric' value, there is nothing good to suggest. There are multiple possibilities. Which numeric value would you expect 'A' to become? Also, are there other non-numeric characters that you would want to convert? How many are there and what would their numeric equivalents be? -- Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    And what language or tool would you be using?
    49,550 pointsBadges:
    report
  • philpl1jb
    We don't know what you want.  Are you trying to do this in RPGLE?  Do you want something like this?
    A=1.0
    B=2.0
    C=3.0
    ETC?
    
    So 'CAS00TST01A' extracts the A and converts it to 1.0
    49,550 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following