Search code examples
etldatastageibm-infosphere

How to get current date -1 (yesterday) in DataStage?


Hello i've been working on how to get yesterday date in DataStage?

CurrentDate()-1

When i compile the job, it gave me an error. So how should i do to get the yesterday date? btw that code i'm doing it in the Transformer stage


Solution

  • Assuming you are using the parallel engine in DataStage - this could be a solution

    DateOffsetByComponents

    DateOffsetByComponents(CurrentDate(), 0, 0, -1)
    

    As the last parameter is the day part and -1 would substract a day