Sorting Date columns

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

tsn
Participant
Posts: 51
Joined: Wed Jan 10, 2007 1:32 am

Post by tsn »

why you are getting NULL, because the output link consider the date input as string and while writing it is trying to convert to DATE, fails to convert and NULL was passed to output.

Can you check whether any ^M character in the EOR and check whether length and display are given correctly.

still if you get the NULL, the place a transformer before sort. use iconv to convert the date into number, place sort stage, sort it, and then place a transformer. use oconv to convert to date format and then write it in the file
with regards,
tsn
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

My test file just had 1 column with a date in the format dd/mm/yyyy. I declared it as type "date" and sorted it, then output it as type "VarChar" to another sequential file.

When I changed the output to "Date" as well I get the following warning:
TestServerSort..Sort_4: At row 1, link "DSLink5", while processing column "In.String"
Value treated as NULL
Attempt to convert String value "01/01/2007" to Date type unsuccessful
Perhaps you could have mentioned that warning in your initial post, it would have saved much writing and effort.
Post Reply