Opcode in RPG that retrieves current date

295 pts.
Tags:
AS/400
RPG
Which opcode in RPG can be used to retrieve current date along with century?

Answer Wiki

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

The TIME opcode with a 14-digit result field, the %DATE built-in, or the %TIMESTAMP built-in are three that come to mind.

==================================================

The DATE positions 191-198 of the program status data structure provides a 4-digit year.

Tom

Discuss This Question: 4  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.

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
  • Try
    *DATE
    35 pointsBadges:
    report
  • WoodEngineer
    This will return today's date as CYYMMDD. Just modify the *CYMD0 parm to get other date formats. D Today70 S 7 0 C/Free Today70 = %int(%char(%date():*CYMD0)) ;
    6,765 pointsBadges:
    report
  • BigKat
    at V5R3+ Today70 = %dec(%date():*CYMD0) ;
    8,350 pointsBadges:
    report
  • Splat
    To expand slightly on the examples provided:
    D ISO  S  8 0 
    
    ISO = %dec(%date():*ISO0) ;
    Assuming you're looking for the full, four digit year.
    7,565 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