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
cyymmdd to timestamp
Moderators: chulett, rschirm, roy
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
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
-
- Participant
- Posts: 3337
- Joined: Mon Jan 17, 2005 4:49 am
- Location: United Kingdom
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.
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.