|
----- Message from "Stone, Joel" <Joel.Stone@xxxxxxxxxx> on Wed, 28
Nov 2012 19:57:32 +0000 -----
To:
"'COBOL Programming on the iSeries/AS400'" <cobol400-l@xxxxxxxxxxxx>
Subject:
Re: [COBOL400-L] how to extract the most common date format - YYYYMMDD
Thanks but here is IBM doc example from "Websphere Development
Studio ILE COBOL reference" v5 SC09-2539-02:
MOVE FUNCTION EXTRACT-DATE-TIME (date-2 '%m/%d') to alphanum-1.
It's a stinker - I guess I will have to format as 2012/11/28 and
then SUBSTRING out the slashes.
It seems that once the slashes or spaces are gone from the edit
string, the compiler chokes because it thinks it is numeric.
Is it possible that it is impossible to pull the most common date
format? Does no one else use the cobol compiler with dates?
So here is the ugly code that I created:
move function EXTRACT-DATE-TIME (ws-date '@Y/%m/%d')
to ws-date-yyyy-mm-dd
string ws-date-yyyy-mm-dd (1:4)
ws-date-yyyy-mm-dd (6:2)
ws-date-yyyy-mm-dd (9:2)
delimited by size into A0468X-DUE-DATE of AFTR
Does anyone else use DATE functions in COBOL/ILE? Maybe the are
full of bugs??
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.