Date Conversion

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

Post Reply
justlrng
Participant
Posts: 30
Joined: Thu Oct 16, 2003 1:17 pm

Date Conversion

Post by justlrng »

I have a job that reads in a timestamp of 1900-01-01 00:00:00.000 and I want to read it out to a sequential file as 1900-01-01 00:00:00. The problem is DataStage for some reason is not reading the 1900-01-01 properly. The other date statements will convert properly but not this one.

The statement we are using is (eff_start_dt in this case happens to be 1900-01-01 for all records)
Oconv(Iconv(seqCodeTypeIn.eff_start_dt,"D-YMD[4,2,2]"),"D-YMD[4,2,2]") : " " : Oconv(Iconv("00:00:00")"MTS"),"MTS")

The resulting date for this statement is 00:00:00.

If I get the substring of seqCodeTypeIn.eff_start_dt to get just the date portion of the timestamp then I get the right results.

My question is this: Is the date 1900-01-01 a special date in DataStage? Why would the same statement handle any other date (so far :wink: ) and not 1900-01-01?

Thanks.
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

No, there's no special date. Why not just do a LEFT(yourdate, 19) or FIELD(yourdate, ".",1) instead of all the manipulation you're doing. Everything is a string inside DS, so just lop off the last 4 characters.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
justlrng
Participant
Posts: 30
Joined: Thu Oct 16, 2003 1:17 pm

Post by justlrng »

Well, that certainly would make it much simplier :)
I was just curious about the date.

Thank you Kenneth.
Post Reply