AS/400 DDS mandatory check issue

105 pts.
Tags:
AS/400
DDS
Good morning, So my issue is that I have an input screen it asks a user to input a bunch of fields and write/updates a file and a lot of the fields on screen need to be ME (mandatory entries). What I'm trying to do is not have the screen clear when the user hits enter. (So if it fails a check the screen doesn't erase and make the user retype all fields). The fields are now holding their values but the ME check still makes the user type over the fields so for example:
  1. User puts in company:__4__ ( user types in info).
  2. User hits enter to write to file (program checks data)
  3.  A. If info is good write record clear screen. B. If info is bad show message on screen to tell user bad data and do not clear screen. This all works.
  4. User sees the same screen after the check : company:____4_.
  5. User Hits enter and screen says mandatory entry even though the 4 is still there. And will not continue until the user types a 4 over the original 4.
Let me know if anyone has suggestions or if you need more information.Thanks guys.
1

Answer Wiki

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

I have never been a fan of the ME for display files. Simple fields I would use the VALUES keyword. I would test conditions in the program and if all a valid, then press a command key to process otherwise re-display the screen with the error message for the field test that failed.

Discuss This Question: 5  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.
  • bp01442
    Well there's 30 something fields on this particular screen. I'm trying to avoid having to code a line for each field. But that honestly may be the only way to go. Thanks for your reply. 
    105 pointsBadges:
    report
  • Splat
    You'd be better off having the program require entries & redisplaying the screen (with appropriate messages and/or highlighting) if the fields aren't populated.
    12,835 pointsBadges:
    report
  • ToddN2000
    If you want to keep the data they enter justified to one side use the CHECK(RB) or CHECK(RZ) reserved word this will blank or 0 fill the result entered. You can also still use the ME.
    ex .CHECK(RB ME)
125,940 pointsBadges:
report
  • WoodEngineer
    Inspecting each field may well be the best option.  Just because a user enter "4" in company number does not mean that field remained unchanged after the screen was re-displayed because of a missing ME field.
    Programs ofter re-validate all fields everytime the entry fields are returned to the program.
    Yes, lots of work and often a dedicated indicator for each of the 30 fields.  However, it is worth the effort to insure valid data is getting into the system.
    There is a field-level keyword which indicates to your program that a field's value was changed.  Again, more indicators.  The advantge of this method is that your validation program can be coded to only validate the fields which changed.  If memory serves, if a user were to re-enter "4" for company number the change indicator would be turned on even though the value did not change.
    This method is a viable alternative to the ME keyword, giving your program better control.
    8,225 pointsBadges:
    report
  • ToddN2000
    AS mentioned by other posters, checking in the program may be the best option. The reason is if you are not using the values option, how do you verify the data entered is correct? example you have fields labeled division and warehouse. If you only have a few then the VALUES may work for you. Otherwise you may need to verify the entry against another file to make sure it's valid. It may be a pain and take more time coding but this way you have a much more stable application.
    125,940 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.

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

    Following

    Share this item with your network: