where LASTCHGDATE is a char stage variable which has the value of
'ccyy-mm-dd' based on the value of CDB6ED-LAST-CHANGE-C i.e. if
CDB6ED-LAST-CHANGE-C=0 then cc='19' else cc='20'.
but the problem is in the resultant flat file I only get all zeroes regardless of the original date(source date)
like 0000-00-00-00.00.00.000000.
I think Sainath.Srinivasan has probably nailed your problem. The CAST function expects a DataStage format timestamp (i.e. without the dash between the date and time portions).
I think Sainath.Srinivasan has probably nailed your problem. The CAST function expects a DataStage format timestamp (i.e. without the dash between the date and time portions).
Mike
But the delimiters could be anythg right? I mean 'hh.mm.ss.ssssss' or should it only be 'hh:mm:ss.sssssss'
I don't have access to a mainframe to try some options, but this is what I would assume would be the way that CAST AS TIMESTAMP would work:
1) If character, I would expect that you would have to provide a 26-character string in standard DataStage timestamp format.
2) If date, I would expect the CAST to add 00:00:00.000000.
Mike wrote:DataStage standard timestamp format is "CCYY-MM-DD HH:MM:SS.NNNNNN". I assume the time delimiters probably matter.
Mike
No, when I get the current timestamp its displaying the timestamp in
'CCYY-MM-DD-HH.MM.SS.NNNNNN' format not in "CCYY-MM-DD HH:MM:SS.NNNNNN" , thats why I chose that way.
But even with this format its not working.
I don't have access to a mainframe to try some options, but this is what I would assume would be the way that CAST AS TIMESTAMP would work:
1) If character, I would expect that you would have to provide a 26-character string in standard DataStage timestamp format.
2) If date, I would expect the CAST to add 00:00:00.000000.
What kind of error do you get. I was able to generate code to do the double cast. The generated code looked like it was moving zero to the various time components. I am not able to execute the job, but it looks like the generated code should run compile and run just fine.