• Subject: %Char and Date Fields
  • From: Jon.Paris@xxxxxx
  • Date: Mon, 18 Dec 2000 16:35:28 -0500


 >> As I understand the above, I should get a character representation of
the date in USA format. However, I am getting ISO format.


You need to do one of two things.  Either code an externally described DS
in your program using the format of the database file for the description
OR code the DatFmt(*USA) keyword on the H spec of the program.  The first
method is probably the better one as it will handle dates in any format
(i.e. the file can contain dates in multiple formats).

The reason this works (and the cause of your problems) is that RPG assigns
an internal format to all date fields and will convert the date from the
file format (*USA) to the default format (*ISO if you have no DatFmt on the
H spec) on input.  By coding the fields in a DS you effectively tell the
compiler to honor the original format.  The same principal applies to
numerics - everything is converted to packed unless you specify otherwise
by defining the field in a different format.

This is all in the manual somewhere but I can't recall where.

+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

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.