Edit mask on date field in AS/400

25 pts.
Tags:
AS/400 command functions
AS/400 commands
OS/400
V6R1
Is there some trick that would allow using an edit mask on a true date field? I need to display a date in *USA format and allow the user to edit the date. If I convert the date to a numeric field, I can use the EDTWRD and EDTMSK keywords to accomplish what I want. If I display the date specifying "DATFMT(*USA)", it looks perfect, but the slashes are not masked. Trying to use either EDTWRD or EDTMSK on a date field yields an error. With numerous date fields in this maintenance program, it would be convenient to avoid converting each one to a numeric filed for I/O and then having to convert the input back to a true date field for the file update.

Software/Hardware used:
AS/400 model 525, OS/400 V6R1

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: 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.

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
  • CharlieBrowne
    Is this for display only or do you want the user to update also?
    41,370 pointsBadges:
    report
  • BWierman
    The user must be allowed to edit (change) the date.
    25 pointsBadges:
    report
  • TomLiotta
    Since EDTMSK() must be specified with either EDTCDE() or EDTWRD(), and both EDTCDE() and EDTWRD() require Numeric-only(Y) field type or similar numeric field type, I don't see how a Date(L) field type is possible. Date fields allow characters that numeric-only fields don't allow. One purpose of a Date field is to allow date format *JOB to change how Dates are displayed and processed by display files for different users. A change in date format could easily destroy the integrity of an edit mask. A date format for one user might be YYYY-MM-DD, but MM/DD/YY for another user. I suspect that IBM chose to eliminate the possibility of conflict. Those who write emulators are probably more able to do so if behavior is predictable. I suppose it'd be nice if IBM allowed EDTMSK() if DATFMT(*JOB) wasn't specified. Then again, IBM has endured a lot of pressure to replace green-screen output with native GUI output. It was probably hard enough just getting all of the underlying 5250 functions to work at all through telnet. Even then there was widespread complaining that 'interactive' cycles cost money. I won't expect EDTMSK() for Date fields any time soon. Tom
    125,585 pointsBadges:
    report
  • BWierman
    Tom: Thanks for the response. It seems to me that the program specs should override the job specs. Nevertheless, IBM probably doesn't have sufficient reason to spend resources on this issue. I've resigned myself to the dual conversion, converting data from the files to numeric for display, then converting the input from the display to true dates for file update. It just seems like a problem that LOTS of programmers have to be dealing with. While I'm fully on board with the concept of moving to a GUI interface, I don't have the authority to make the decision for the company. While we continue to keep current on hardware and software, our company has decided that a mass conversion from green screen doesn't offer sufficient benefit to offset the cost. I not only can't present a compelling argument against that, I don't really want to try; it's not my place. There's plenty of functionality available without the overhead of conversion. Still, it's disappointing that IBM can't find a method to allow the functionality of the EDTMSK keyword with a true date field. Is anyone from Rochester or Toronto listening? Bob
    25 pointsBadges:
    report
  • TomLiotta
    it’s disappointing that IBM can’t find a method to allow the functionality of the EDTMSK keyword with a true date field. Yet IBM isn't responsible for all of the emulators. Emulators are where the work is actually done. TN5250 and TN5250E are internet standards. There are multiple sources of emulators, and this type of change could negatively affect all of them. It would also affect passthru methods where the source system (or existing remote controller or whatever) does the display work. Also, products from 3rd-party vendors are commonly used internationally, and therefore commonly depend on DATFMT(*JOB) in order to adapt automatically to local preferences. For such uses, EDTMSK() would not be usable. That eliminates a major source of support for the concept and possibly even raises opposition. I'm not arguing against it; just thinking of potential impact. 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