×
The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.
I'm pretty sure that the *ISO and *USA, etc. are just the external representation of some unknown internal date form, which allows dates in a field defined with *ISO to be shared with *USA with impunity. However, I tried to make everything *USA, and it made no difference as expected. The MAPVAL keyword only cares because it is looking at external formats. I can keep everything in my program in *ISO and display it to a user in whatever format I like. Now there is an issue when shifting between 4 digit year formats (like *ISO and *USA) and 2 digit year formats (*MDY). The *ISO and it's ilk can store dates from 0001-01-02 to 9999-12-31 while the *MDY formats can only store from 01/01/40 to 12/31/39.
My issue is that the documentation says that:
Example
The following example shows how to specify the MAPVAL keyword.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A
00020A R RECORD
00030A DATFLD1 L DATFMT(*MDY) DATSEP('/')
00040A MAPVAL(('01/01/40' *BLANK))
On output, if the field data equals '01/01/40', the field data is changed to all blanks. On input, if the field data is blank, the field data is changed to '01/01/40'.
My experience is notably contrary to this example, and though I am using *USA vs. *MDY, that shouldn't matter except for the format of the date in the MAPVAL.
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
-----Scott Mildenberger <SMildenberger@xxxxxxxxxxxxxxxxxx> wrote: -----
To: "RPG programming on the IBM i (AS/400 and iSeries)" <rpg400-l@xxxxxxxxxxxx>
From: Scott Mildenberger <SMildenberger@xxxxxxxxxxxxxxxxxx>
Date: 07/30/2014 02:12PM
Subject: RE: MAPVAL issues
It might be related to what format the date field is getting assigned in your program, might not be compatible if it is *ISO for example. Try setting the DATFMT on your h spec to *USA also.
Scott
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Mark Murphy/STAR BASE Consulting Inc.
Sent: Wednesday, July 30, 2014 11:29 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: MAPVAL issues
Does anyone use the MAPVAL keyword? I am having the following issue,
My date field is defined like so:
A RPTDT L I 5 29DATFMT(*USA)
A MAPVAL(('01/01/0001' *BLANK))
I am reading into a data structure defined like this:
dcl-ds dsprec likerec(display: *all);
But when I read the record (using EXFMT), a blank keyed on the screen is input as a blank which causes invalid format error when the field is used.
What am I doing wrong?
Mark Murphy
STAR BASE Consulting, Inc.
mmurphy@xxxxxxxxxxxxxxx
As an Amazon Associate we earn from qualifying purchases.
This thread ...
MAPVAL issues, Mark Murphy/STAR BASE Consulting Inc.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact
[javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.