----- Message from "Stone, Joel" <Joel.Stone@xxxxxxxxxx> on Wed, 28
Nov 2012 19:57:32 +0000 -----
"'COBOL Programming on the iSeries/AS400'" <cobol400-l@xxxxxxxxxxxx>
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')
string ws-date-yyyy-mm-dd (1:4)
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.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.