Current Date in RDML

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
sotis
Posts: 16
Joined: Thu Sep 16, 2021 11:37 pm

Current Date in RDML

Post by sotis »

Hello,

is there any way to get the current date in ISO format only with RDML (no RDMLX)?

e.g.
Define Field(#CURDATE) TYPE(*CHAR) LENGTH(10) DEFAULT('''2023-01-02''')

note TYPE(*DATE) wont work for RDML

thanks,
Sotiris
adale
Posts: 210
Joined: Wed Apr 08, 2020 9:18 pm
Location: Poplarville, MS

Re: Current Date in RDML

Post by adale »

Sotiris,
The BIF ConvertDate might be what you are looking for (review the date format codes).
https://docs.lansa.com/15/en/lansa015/c ... RTDATE.htm

Here are a couple ideas to work with:

* quick test work for forum date question
Define Field(#CURDATEN) Type(*DEC) Length(8) Decimals(0)
Define Field(#CURDATEA) Type(*CHAR) Length(10) Default('''2023-01-02''')
Define Field(#wk_DATE) Type(*CHAR) Length(10)


* as a numeric value:
Change Field(#CURDATEN) To(*YYYYMMDD)


* as a character value
Use Builtin(NUMERIC_STRING) With_Args(#CURDATEN) To_Get(#wk_DATE)
Use Builtin(CONVERTDATE) With_Args(#wk_DATE J K) To_Get(#CURDATEA)


* or manually
* as a character value with " - " separator
Change Field(#CURDATEA) To('''----------''')
Substring Field(#WK_DATE 1 4) Into_Field(#CURDATEA)
Substring Field(#WK_DATE 5 2) Into_Field(#CURDATEA 6 2)
Substring Field(#WK_DATE 7 2) Into_Field(#CURDATEA 9 2)
Arlyn Dale
Servias LLC
Post Reply