Hi,
I'm new to DataStage and have an issue regarding a transform.
All my job has to do is load a .csv file into an SQL2000 tabel.
File consists of temperature measures by day:
2007-1-1; 30
2007-1-2; 34
2007-1-3; 29
2007-1-4; 24
...
Problem is that I encouter the following error message when trying to insert all values in the table:
"[DataStage][SQL Client][ODBC][Microsoft][ODBC SQL Server Driver]Invalid character value for cast specification"
I think I know the problem since only the records conaining a date of format yyyy-mm-dd are inserted.
So in my transform stage I should transform 2007-1-1 to 2007-01-01.
How should I transform this???
Thnks!!!!
Transform yyyy-m-d to yyyy-mm-dd
Moderators: chulett, rschirm, roy
You would convert it to internal format, then back to display format.
Code: Select all
OCONV(ICONV(In.DateString,'D4-YMD'),'D4-YMD')
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Arnd left out the "[4,2,2]" which might result in a single digit month or day number.
Just for laughs here's an alternative.
Just for laughs here's an alternative.
Code: Select all
Fmt(Fmt(Field(InLink.TheDate,"-",1,1),"R%4") : Fmt(Field(InLink.TheDate,"-",2,1),"R%2") : Fmt(Field(InLink.TheDate,"-",3,1),"R%2"), "L####-##-##")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.