Setting dates and times

Some keywords allow you to enter dates, times, or date and times. To use the current date, time, or datetime, you can enter the equal sign (=) as the only content of the keyword.

The following restrictions apply to the use of the equal sign (=) for dates and times:

  • It can be used only for fields whose value is specifically a date, time, or datetime. You cannot use it for any other type of field, DESCR(=) is not a date or time short form, DESCR(=) will result in the description being set to a single equals sign.
  • It cannot form a part of the data. For example, IA(=) is allowed, while IA(060124=) is not allowed.
  • Do not use the equal sign (=) for field values in conjunction with native PIF comparators. For example, IA-GE(=) is allowed, while IA(=<=) is not allowed.

The value used must be appropriate to whatever the date and time was when Workload Automation Programming Language started. You can specify your own values to substitute for the equal sign (=) by using OPTIONS DATE and OPTIONS TIME.

You can also use the plus sign (+) or minus sign (–) in date or time fields to set dates or time relative to the Workload Automation Programming Language internal date and time. For example, VALFROM(+7) will be a date in 7 days time, STARTTIME(+10) will be in ten minutes time.

If you use the plus sign (+) or minus sign (–) in a time field, this might result in carry over to other fields if the addition or subtraction crosses a date boundary. Be aware that in some cases this can create an invalid value for some fields. The following fields perform automatic carryover:

  • OPTIONS TIME will carry over into OPTIONS DATE
  • Long Term Plan IAT will carry over into IAD
  • Long Term Plan PREIAT will carry over into PREIAD
  • Batch Loader ADOP STARTTIME will carry over into STARTDAY
  • Batch Loader ADOP DLTIME will carry over into DLDAY
Note: For consistency, the equal sign (=) short form uses the date and time when you started your Workload Automation Programming Language session. This ensures that you can use the equal sign (=) throughout your command statements with consistency, preventing potential problems with dependencies being missed. The exception to this is the @ function, which uses the input arrival of the occurrence in which the Workload Automation Programming Language job is running, if the job is under HCL Workload Automation for Z control.

For dates, the plus sign (+) or minus sign (–) adds or subtracts a number of calendar days to the date. To add or subtract work days, you can use the WD suffix. For example, ADD ADID(MYAPPL) IADATE(+3WD) adds the application to the plan 3 working days from the current date.

When the job is being controlled by HCL Workload Automation for Z, the calendar used by the calculation is the application calendar; otherwise the default calendar, that you can set with OPTIONS CALENDAR, is used.

The calendar can be specified within the keyword by following the date offset with a slash (/) and the calendar name, for example ADD ADID(MYAPPL) IADATE(+3WD/MYCAL).