Change date format in RPGILE

265 pts.
Tags:
RPG/400
RPGILE
Can you advise me how to change date format from mmddyyyy to yyyymmdd in rpgile?
ASKED: April 2, 2009  2:59 PM
UPDATED: August 23, 2013  3:07 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

1 Is this a D – date type field?
2. How are you using it — please give an example of what isn’t working.
Phil

You want tthe system date into a 8 char field CCYYMMDD

Date8a = %char(%date() : *iso0)

%date() returns the system date
%char( datetype : *iso0 ) returns a character field with *iso format (CCYYMMDD) the zero in *iso0
indicaties no field seperators like / or :
///////////////////////////
This statement gets the current date into dt
Ddt s d datfmt(*iso)
C eval dt = %date()

the statement below gets the current date and puts it in an 8 alpha in CCYYMMDD

D dsstsdt s 8a
C eval dsstsdt = %char(%date() : *iso0)

Phil

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Askt
    I need to get system date that i convert into (YYYYMMDD) moved into resultant field. what i tryed is Ddt s d datfmt(*iso) I am not sure which form need to give here C move udate dt after that i moved dt to resultant field. resultant field : dsstsdt 8a please advice.
    265 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following