My file(RECFM=VB) is created by a CICS program which moves EIBDATE(S9(7) COMP-3 - 0CYYDDD+) and EIBTIME(S9(7) COMP-3 - 0HHMMSS+) values into a field. I used the below sort to convert them into the desired format. I am convinced about the date conversion, but can someone please explain if the time shown is correct? The actual requirement is to create a DB2 timestamp out of those 2 fields.
Based on my analysis it seems the results produced by DFSORT are correct? Is the data incorrect in the file or are there any problems in the timeconversion? Can someone please suggest any better way if exists to convert the DATE,TIME fields into DB2 timestamp format? YYYY-MM-DD-HH.MM.SS.000000
Joined: 20 Oct 2006 Posts: 6968 Location: porcelain throne
if you want the above to be your 'timestamp' format, great.
depends on the ultimate purpose of your generated 'timestamp'.
most of the time yyyy-mm-dd-hh:mm:ss:mmmmmm is the pattern
but that can be overridden with 'timestamp format' parm in the timestamp scalar function in db2 10
(probably earlier, but i am to lazy to look
since I have always used yyyy-mm-dd-hh:mm:ss:mmmmmm
as my pattern and never have had any trouble using that as a host variable).
i am ignoring the 'hex values' that you have provided.
they make little or no sense.
so, why don't you tell us for what use you intend your 'generated timestamp'
and we may be able to help.
2012-10-17-0021120 is 2012-10-17-0hhmmss
so what you are generating now is useless.