Infosphere Datastage – Useful Date Transformations
Here are few Datastage date transformation, which I have found useful, many of these can Also be accomplished in SQL, if sourcing your data from an RDBMS.
Useful Date Transformations
Item | Description | Result |
Tomorrow | DateFromDaysSince(1, CurrentDate()) | |
Yesterday | DateFromDaysSince(-1, CurrentDate()) | |
Convert date to string with dashes | DateToString((<< Date_Field or CurrentDate() >>,”%,”%YYYY-%MM-%DD”) | 2011-11-02 |
Convert date to string without dashes | DateToString(<< Date_Field or CurrentDate() >>,”%YYYY%MM%DD”) | 20111102 |
Get short month name | DateToString(<< Date_Field or CurrentDate() >>,”%,”%mmm”) | Feb |
Get long month name | DateToString(<< Date_Field or CurrentDate() >>,”%mmmm”) | February |
Get short weekday name | DateToString(<< Date_Field or CurrentDate() >> date_value,”%eee”) | Tue |
Get long weekday name | DateToString(<< Date_Field or CurrentDate() >> ,”%eeee”) | Tuesday |
Irregular Date Format (months and days can be 1 or 2 digits) | StringToTimestamp((<>,”%m/%d/%yyyy”) | 2011-11-02 |
3 Comments