Page 2 of 2

Posted: Fri Mar 04, 2005 11:38 am
by srikie
Code generation is fine but when you try to execute the jcl it gives the error of invalid casting. If you see the documentation of data type definitions and mappings, mapping date to timestamp and vice versa is invalid.
Thanks
srikie

Posted: Fri Mar 04, 2005 11:53 am
by Mike
One part of the documentation says the 'DSC2TS' RTL function expects the standard internal DataStage timestamp format. Then it says "(The separator characters need not be dashes and periods.)" It doesn't say anything about the colon (:) separators. Did you try the DataStage timestamp format?

I would suggest adding a "debug" file to check that the concatenation is working as you expect. Add an extra fixed-width flat file output stage and map your concatenated timestamp (before conversion by DS) and the timestamp (after conversion by DS) as two of the columns in the flat file.

Mike

Posted: Fri Mar 04, 2005 12:00 pm
by srikie
Thanks Mike I would try that out.Yes, I tried Data stage timestamp internal format it dint work either.

Posted: Fri Mar 04, 2005 1:07 pm
by Sainath.Srinivasan
Srikie,

Can you try inserting your system date as default into that column. This will first prove that the column can hold.

Next, use the date format and use the 'date format' of the timestamp in the target field. This will enable DataStage to trigger the conversion by itself. I assume you were trying that earlier.

Can you say what happens if you insert a date without a time in that field.

CAST function is internal to DB2. COBOL will only consider the value as a string and pass it directly to DB2 to prepare and execute. So as long as you can try the double-cast successfully in DB2 via its client, it must work from DataStage generated COBOL.

Posted: Tue Mar 08, 2005 4:34 pm
by srikie
Thanks everyone.I think I nailed the problem down. I dint validat ethe date before casting onto timestamp. Now its workin fine.
Thanks once again