AS/400 RPGLE

620 pts.
Tags:
AS400 RPGLE
When I'm converting the date to another formats, I get below runtime error, please advise. Error: The target for a numeric operation is too small to hold the result..
Program:

0001.00 DA                S              8  0

0001.01 DB                S              6  0

0001.02 DC                S              8  0

0001.03 DD                S             10  0

0001.04 C                   EVAL      A=%DEC(%DATE())

0001.05 C                   EVAL      B=%DEC(%DATE(A:*JUL) )

0001.06 C                   EVAL      C=%DEC(%DATE(A:*DMY) )

0001.07 C                   EVAL      D=%DEC(%DATE(A:*EUR) )

0003.00 C     A             DSPLY

0003.01 C     B             DSPLY

0003.02 C     C             DSPLY

0003.03 C     D             DSPLY

0004.00 C                   SETON                                        LR
0

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 3  Replies

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

    The code you've posted should not produce an error.

    54,090 pointsBadges:
    report
  • philpl1jb

    Sorry, misread your code

    0001.05 C                   EVAL      B=%DEC(%DATE():*JUL )

    No error on the code above

    0001.05 C                   EVAL      B=%DEC(%DATE(A:*JUL) )

    error here

    (%DATE(A:*JUL)   here the date function is going to convert a numeric to a date.  the :*JUL indicates that it should expect the numeric input field A to be in Julian format .. it isn't it's in system default format. 

    0005.02 C Eval B=%dec(%date(A):*jul)

    this time it's %date(A) which converts to a date from the default format then it's %dec (    : *jul )   where it now converts the date to

    a decimal in Julian format.



    54,090 pointsBadges:
    report
  • chowas400
    yeah, got it now..

    Thank you very much ..Phil
    620 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.

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

Following

Share this item with your network: