how to prevent values

1400 pts.
Tags:
AS400 RPGLE
how to prevent  these values &<>" in a field

Answer Wiki

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

If the only way to update a field in a file is programatically, you can add an edit to that program(s).
We all know that files are updated many other ways: CPYF, DBU, UPDDTA, SQL, etc, the only solution is to add a trigger program to the file. In the program you can vaildate your field and then take whatever action you want.
You may want to convert those invalid characters to blanks and sent out an an error message.
Depending on the possible values in the field, you could just add a Constraint ADDPFCST

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
  • WoodEngineer
    RPG supports calls to the regular expression API. It is designed to handle the situation you describe. However, unless you are familiar with regular expressions it may be a lot quicker to code up an RPG procedure.
    6,875 pointsBadges:
    report
  • TomLiotta
    ...in a field What "field"? A database field? A field in the program? A display field? A Printer field? Are those always going to be the only characters that must be prevented? Tom
    125,585 pointsBadges:
    report
  • 9783444184
    Hi Tom, Display field entry field....
    1,400 pointsBadges:
    report
  • CharlieBrowne
    If it is a field being entered from a DSPF, they you need to add an edit in your program to check for those invalid characters.. You can then force an error an make the user correct the value.
    41,430 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