Question

  Asked: Jun 11 2008   4:35 AM GMT
  Asked by: C.naveen09


How to convert a Date given in Char format to numeric format in RPG of As400.


RPG/400, RPG, AS/400

How to convert a Date given in Char format to numeric format in RPG of As400..

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



EVAL numericField = %dec(%date(alphaDate:*MDY/):*MDY)

The parm following the char field must be the format of the char field (I used *MDY with "/"for an example).

The parm at the end of the expression must be the format of the numeric field.
So this example converts 11/22/2008 to 11222008.

If you want 2008-11-22 converted to 20081122 make both parms *ISO.

Give an example of what you want and we can be more specific.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register