I recently had a requirement where I needed to validate that the incoming string was a valid Date.
I used the IsValidDate function to accomplish this. And this unexpectedly resulted in the warnings for every invalid date record in the job log.
APT_CombinedOperatorController(0),1: Conversion error calling conversion routine timestamp_from_string data may have been lost
APT_CombinedOperatorController(0),1: Data string '20220615' does not match format '%mm/%dd/%yyyy %hh:%nn:%ss': the value for tag %yyyy has fewer characters than expected.
This obviously needs fixing as the Sequencer expected the job to finish with any warnings.
There is an IBM Solution listed here
https://www.ibm.com/support/pages/transformer-stage-using-isvalid-function-throws-warning-datastage
I applied a similar work-around to convert 20220615 in a valid date format Left(Inp.Col,4) : '-' : Convert('-','',Inp.Col)[5,2] : '-' : Right(Inp.Col,2).
This reads 20200615 as well as 2020-06-15 as valid dates.
This did not happen in earlier versions of Datastage. I think it started happening after 8.x
ReplyDelete