The Link doesn't seem to be available any more. Even after signing on to the web site.

Thanks,

Gary

On 5 Jan 2015 at 22:24, Sam_L (Sam_L <rpg400-l@xxxxxxxxxxxx>) commented about
Re: Converting a date:

Gary,

There is probably an easier way to do what you want to do and probably
with far fewer lines of code... Check out this V5R3 article from 2008
which may help.

http://www.mcpressonline.com/programming/rpg/rpg-iv-legacy-dates-cheat-sheet.h
tml

Sam

On 1/5/2015 7:17 PM, Gary Kuznitz wrote:
I can't seem to figure out how to reformat a date to get it in *USA
format.

The error I'm getting is:
*RNF7606 20 2000004 The Data-Format entry is A or N but field
DTEOFHIRE is
not of type character or indicator.

D DTEOFHIRE 10D INZ DatFmt(*USA)

O DTEOFHIRE

DDS:
A DTEOFHIRE L TEXT('Employment Date')
A COLHDG('Employment' +
A 'Date' )

I'm running this on V5R3.

It could easily be I haven't loaded DTEOFHIRE correctly.
I read in Emplydate. EmpMonth is a 3 char Month Jan, Feb

D DS
D Emplydate
D EmpDay 2 0 Overlay(Emplydate:1)
D EmpMonth 3 Overlay(Emplydate:4)
D EmpYear 2 0 Overlay(Emplydate:8)
D DS
D Empdate2 10A
D EmpCentury 2 0 INZ(20)
D EmpYear2 2 0 Overlay(Empdate2:3)
D EmpMonth2 2 Overlay(Empdate2:6)
D EmpDay2 2 0 Overlay(Empdate2:9)

I do a lookup on a table to get the month
C Z-ADD 1 X 2 0
C EmpMonth LookUp Months(X) 31
C Move Empdate2 DTEOFHIRE

I have tried many different approaches including adding slashes to Empdate2
and
changing Empdate2 from *Char. I don't know what I must be doing wrong even
though
there must be 20 different ways this can be done.

Thanks,

Gary


---
This email has been checked for viruses by Avast antivirus software.
http://www.avast.com

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