0 pts.
 Convert an iso date to julian date
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

Software/Hardware used:
ASKED: October 27, 2004  4:36 PM
UPDATED: October 6, 2010  2:08 AM

Answer Wiki:
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
Last Wiki Answer Submitted:  October 6, 2010  2:08 am  by  AdamVan   0 pts.
All Answer Wiki Contributors:  AdamVan   0 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Since you’re using ILE, you could create a CL procedure using CVTDAT and have it return a julian date.

 0 pts.

 

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 pts.