How to pass Zoned Decimal parameter to a Program from the command line?

770 pts.
Tags:
AS/400
How to pass Zoned Decimal parameter to a Program from the command line?

Software/Hardware used:
AS400

Answer Wiki

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

Discuss This Question: 4  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
  • BigKat
    just put quotes around it and include any leading zeros call pgm parm('0001') would call pgm with a zoned (4,0) value of 1.
    8,200 pointsBadges:
    report
  • philpl1jb
    and call pgm parm(’0001′) would call pgm with a zoned (4,2) value of .01 but negative values ....
    49,950 pointsBadges:
    report
  • TomLiotta
    Zoned-decimal is just a series of character digits. Because they are "characters", they must be quoted to prevent the command prompter from passing them as packed digits. You must include leading zeros if the quoted value has fewer digits than the length of the field.As mentioned, negative values require some special handling to account for the negative sign.Tom
    125,585 pointsBadges:
    report
  • bvining
    Continuing the example of '0001', if you wanted a negative value you need to replace the right most digit with the appropriate character value. Representing a value of 0001- would be done by passing '000J'.  If the last digit is a 2 then replace the 2 with a K, 3 with L, 4 with M, and so on to 9 being R. So passing a negative 1234 would be done as '123M'. A bit more on the details, zoned decimal values of 1 thru 9 are stored, in EBCDIC, as x'F1' thru x'F9'. To represent a negative value you change the "left" nibble of the last digit to 'D'. x'D1' is EBCDIC character J, x'D2' is K,... and x'D9' is R. Other values can be used, but these are the preferred representations.
    6,485 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