numeric field check

pts.
Tags:
AS/400
Data analysis
RPG
RPGLE
i have a file that has a numeric field that is being cleared early in a program if certain conditions are meet as the file is being made...i need to check later before that file is printed to see if those conditions have changed....the numeric field is the key....it's not having zeros put in it..but being cleared...how can i check this qualification in an if statement..won't let me use: field = *blanks using: field = *zero but worried that won't give me what i'm looking for...any suggestions? thanks in advance

Answer Wiki

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

How is the field being cleared? The CLEAR opcode should set the field to its default initialization. Which for a numeric field should be zero or null.
If it’s zero then “field = *zero” should work.
If it’s null then “if %nullind (field)” should work. Nullind will be *on if the field contains a null.

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
  • Jwebb901
    1. When a numeric field is cleared (opcode = clear) the field is set to 0 (*zeros). 2. I would question the use of the field in this way as 0 (zero) is a valid value......you'd be better off to find another way.
    0 pointsBadges:
    report
  • Cowboypgmr
    it's being cleared by: clear field
    0 pointsBadges:
    report
  • TomLiotta
    it’s being cleared by: clear field If that's true and "field" is set to blanks by that operation, then "field" is not a numeric field. And that doesn't go with your earlier assertion that "won't let me use: field = *blanks". One of those assertions is wrong. Which one? Tom
    125,585 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