Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting MOVE to /free 1

Status
Not open for further replies.
as400pro

I agreem with iSeriesCodePoet, that does look confusing. Even though it's more code, I think this is easier to read, and sticks to the KISS principle:

//Convert date from CCYYMMDD to MMDDYY
DateISO = %Date(); // Defined as CCYYMMDD
DateMDY = DateUSA; // Defined as MMDDYY

or is you want the current date stored in ISO format:
DateISO = %Date();

or you want the current date stored in MDY format:

// convert from Julian to CCYYMMDD

DateJul = %Date();
DateUSA = DateJul;

There are other things to consider, like where I'm getting the input data from, etc. But, I try just to stick with using the date opcodes and date data type. Makes the coding much simpler.
DateMDY = %Date();


RedMage1967
IBM Certifed - RPG IV Progammer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top