×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




We have screens coded just like you do except they don't have the DATSEP keyword which shouldn't matter as that defaults to '/' if not specified. Do you only get the error if you key a blank in the field? If you just Field Exit through the field does it also give the error? I know I have sometimes had issues with this but we do have a lot of programs that use it. Do you get the error on the EXFMT statement when it returns to the program or at a later step when you use the field? Can you look at the value coming back from the EXFMT in debug?

I just noticed your field is I for Input, all of ours are either B(oth) or O(utput). Don't know if that has anything to do with it.

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 2:20 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: RE: MAPVAL issues

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
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 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.