Option 1 - do what you're doing in the SQL. This may need slight modification (perhaps CAST function) to make SUBSTR legal as an operand of an date arithmetic operator.
Option 2 - also select DB2 CURRENT TIMESTAMP into a third column, whose data type is TimeStamp (or whose data type is VarChar(26) and whose data element is TimeStamp). Then you can merrily perform your arithmetic directly using DataStage BASIC expression in a Transformer stage.
Timestamp
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
W've done this in the SQL while selecting in the ODBC node itself but would like to do all this using Data stage as they want to use the Datastage to the full. We can accomplish these while selecting itself but then DStage will become obsolete.
How can we write an equivalent - If statement in the Datastage. How can we get the current timestamp using the datastage functions?
Any one Please suggest, Thanks
How can we write an equivalent - If statement in the Datastage. How can we get the current timestamp using the datastage functions?
Any one Please suggest, Thanks
-
- Premium Member
- Posts: 108
- Joined: Sat Feb 05, 2005 6:52 pm
- Location: US
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
DataStage does not have "current timestamp"; it only has current time and current date. Do you want these to move along as rows are processed (in which case use Date() and Time() functions) or to remain constant for the job run (in which case use @DATE and @TIME system variables)?
You then have to convert from internal format and construct your timestamp. This can be done in stage variables.
It would be so much less work (and therefore faster) simply to select the current timestamp from the database into a third column.
You then have to convert from internal format and construct your timestamp. This can be done in stage variables.
It would be so much less work (and therefore faster) simply to select the current timestamp from the database into a third column.
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.