This is another example of a procedure to return date type info
from a passed in date.
there are three inbound parms (1) a date
(2) days to add/subtract from date
(3) include weekends when parm 2 specified
all three parameters are optional.
if a date is not passed then todays date will be used
Whats returned is:
* What is returned
* EVAL date
* DATE.ERROR = 'N'
* DATE.ISO = '2007-08-01'
* DATE.MDY = '08/01/07'
* DATE.USA = '08/01/2007'
* DATE.ISO0 = 20070801.
* DATE.MDY0 = 080107.
* DATE.USA0 = 08012007.
* DATE.JUL0 = 2454314.
* DATE.DAYNAME = 'Wednesday'
* DATE.MONTHNAME = 'August '
* DATE.LSTDAYCUR = '2007-08-31'
* DATE.LSTDAYCURISO = 20070831.
* DATE.LSTDAYCURMDY = 083107.
* DATE.LSTDAYCURCYMD = 1070831.
* DATE.FSTDAYCUR = '2007-08-01'
* DATE.FSTDAYCURISO = 20070801.
* DATE.FSTDAYCURMDY = 080107.
* DATE.FSTDAYCURCYMD = 1070801.
*
* DATE.LSTDAYLST = '2007-07-31'
* DATE.LSTDAYLSTISO = 20070731.
* DATE.LSTDAYLSTMDY = 073107.
* DATE.LSTDAYLSTCYMD = 1070731.
* DATE.FSTDAYLST = '2007-07-01'
* DATE.FSTDAYLSTISO = 20070701.
* DATE.FSTDAYLSTMDY = 070107.
* DATE.FSTDAYLSTCYMD = 1070701.
*
* DATE.STRING1 = '01 Aug 2007 '
* DATE.STRING2 = 'Wednesday, 01 Aug 2007 '
* DATE.STRING3 = 'Wednesday, 01 August 2007 '
* DATE.TIME = '16.05.03'
* DATE.TIMESTAMP = '2007-08-01-16.05.03.000000'
* DATE.WORKISO = '2007-07-01'
*** This is just an example and may contain errors as well as need
more returned info added. Please feel free to do this and repost
so that others may benefit from your efforts.
first create a source file called source (or change copy book).
CRTSRCPF mylib/source rcdlen(112)
then using your favorite method get the 4 source members for this
example into this source file.
compile the member CVTDATE first using option 15
Then create the test programs there is one RPGLE and one CLLE
RPGLE
CLLE
then use debug to see the returned values.
Ive included a v5r3 savefile for your pleasure
library saved from is FMTDATE
cant compile FMTDATTST2 cause I dont have CLLE back
version compile program...so your on your own.
~
from a passed in date.
there are three inbound parms (1) a date
(2) days to add/subtract from date
(3) include weekends when parm 2 specified
all three parameters are optional.
if a date is not passed then todays date will be used
Whats returned is:
* What is returned
* EVAL date
* DATE.ERROR = 'N'
* DATE.ISO = '2007-08-01'
* DATE.MDY = '08/01/07'
* DATE.USA = '08/01/2007'
* DATE.ISO0 = 20070801.
* DATE.MDY0 = 080107.
* DATE.USA0 = 08012007.
* DATE.JUL0 = 2454314.
* DATE.DAYNAME = 'Wednesday'
* DATE.MONTHNAME = 'August '
* DATE.LSTDAYCUR = '2007-08-31'
* DATE.LSTDAYCURISO = 20070831.
* DATE.LSTDAYCURMDY = 083107.
* DATE.LSTDAYCURCYMD = 1070831.
* DATE.FSTDAYCUR = '2007-08-01'
* DATE.FSTDAYCURISO = 20070801.
* DATE.FSTDAYCURMDY = 080107.
* DATE.FSTDAYCURCYMD = 1070801.
*
* DATE.LSTDAYLST = '2007-07-31'
* DATE.LSTDAYLSTISO = 20070731.
* DATE.LSTDAYLSTMDY = 073107.
* DATE.LSTDAYLSTCYMD = 1070731.
* DATE.FSTDAYLST = '2007-07-01'
* DATE.FSTDAYLSTISO = 20070701.
* DATE.FSTDAYLSTMDY = 070107.
* DATE.FSTDAYLSTCYMD = 1070701.
*
* DATE.STRING1 = '01 Aug 2007 '
* DATE.STRING2 = 'Wednesday, 01 Aug 2007 '
* DATE.STRING3 = 'Wednesday, 01 August 2007 '
* DATE.TIME = '16.05.03'
* DATE.TIMESTAMP = '2007-08-01-16.05.03.000000'
* DATE.WORKISO = '2007-07-01'
*** This is just an example and may contain errors as well as need
more returned info added. Please feel free to do this and repost
so that others may benefit from your efforts.
first create a source file called source (or change copy book).
CRTSRCPF mylib/source rcdlen(112)
then using your favorite method get the 4 source members for this
example into this source file.
compile the member CVTDATE first using option 15
PHP Code:
CRTSQLRPGI OBJ(JAMIELIB/FMTDATE) SRCFILE(JAMIELIB/SOURCE)
OBJTYPE(*MODULE)
RPGLE
PHP Code:
CRTRPGMOD MODULE(JAMIELIB/FMTDATTST) SRCFILE(JAMIELIB/SOURCE)
PHP Code:
crtpgm fmtdattst module(fmtdattst fmtdate)
CLLE
PHP Code:
CRTCLMOD MODULE(JAMIELIB/FMTDATTST2)
SRCFILE(JAMIELIB/SOURCE)
PHP Code:
crtpgm fmtdattest module(fmtdattst fmtdate)
then use debug to see the returned values.
Ive included a v5r3 savefile for your pleasure
library saved from is FMTDATE
cant compile FMTDATTST2 cause I dont have CLLE back
version compile program...so your on your own.
~
Comment