Convert an iso date to julian date

0 pts.
Tags:
RPG
I'm writing an rpgle pgm and I need to convert an iso date to a julian date. They don't have taatool here. Was wondering if anyone has an example on how to do this? Thanks in advance for any help
ASKED: October 27, 2004  4:36 PM
UPDATED: October 6, 2010  2:08 AM

Answer Wiki

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

First, define fields as data types:
d jul_date s d datfmt(*jul)
d iso_date s d datfmt(*iso)

Then move the iso date you want to convert into your new *iso field:
move field iso_date

Then move the *iso field into the *jul field:
move iso_date jul_date

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

With the iso_date and jul_date variables defined as above, the ‘conversion’ itself could simply be (in /free):<pre>
jul_date = iso_date ; </pre>
And in fixed-form, it’s just an EVAL.

There doesn’t seem to be much need for anything like TAATOOLS for something this easy. Perhaps the problem is more complex and needs clarification.

Tom

Discuss This Question: 2  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
  • mygoodname
    Since you're using ILE, you could create a CL procedure using CVTDAT and have it return a julian date.
    0 pointsBadges:
    report
  • JimHowe
    Remember, when making this move, there is no exact /FREE internal function for the fixed format MOVE operation. The MOVE operation is a very powerful command, and it is best to code it similar to as follows: Factor 1 Operation Factor2 Result *jul Move your_iso_date your_jul_date this will "convert" the factor 2 field into the Result format. If you are using these as date fields, you must have on your Definition specs both date fields separately specified as a date field, especially if you intend to use the %DIFF or SUBDUR commands. Jim Howe CIS Instructor Augusta Technical College Augusta, GA
    0 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