Search code examples
datastage

How could i set yesterday value as default value for a numeric parameter in datastage?


I have a numeric datatype parameter in Datastage.

*parameter name: VAR_ETL_DATE 
*format:YYYYMMDD
*ex:20210612

How could i set yesterday value as default value for this parameter? Format:YYYYMMDD (numeric)

*Example: Today:20210824 
*When i run a job including VAR_ETL_PARAMETER with default value, The job should run with yesterday value(20210823)

Solution

  • You can't set it in a static sense, because the date of yesterday is a moving target. The best you could do would be to set it in a controlling sequence job that invokes your job. Use any of the date offset functions to set the value. For example you could use Date() - 1 as the generating expression directly in the Job activity in your sequence.