Topic
  • 1 reply
  • Latest Post - ‏2004-05-26T11:14:58Z by SystemAdmin
SystemAdmin
SystemAdmin
93 Posts

Pinned topic Date Function ni Mainframe Job

‏2004-02-26T04:46:25Z |
Hi,

I'm trying to find a way to calculate sums and differences between dates..

E.g. "current date - 1 day" to be used in a transformer stage.

Anybody knows?

Thanks,

Bye
Updated on 2004-05-26T11:14:58Z at 2004-05-26T11:14:58Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    93 Posts

    Re: Date Function ni Mainframe Job

    ‏2004-05-26T11:14:58Z  
    Hello Marco,

    You might try the following command in a transformer
    against a CCYY-MM-DD format date:

    b:1e05f3c7b8CAST(((CAST((CAST(link.date AS DATE)) AS INT)) - 1) AS DATE)[/b:1e05f3c7b8]

    • The 3rd CAST is to convert the given date (in char format) to a date
    format.
    • The 2nd CAST is to convert the date into integer.
    • The 1st CAST is to convert the integer (after subtracting 1 day) to a date.

    Bye

    Mathias

    Hi,

    I'm trying to find a way to calculate sums and differences between dates..

    E.g. "current date - 1 day" to be used in a transformer stage.

    Anybody knows?

    Thanks,

    Bye[/quote:1e05f3c7b8]