SETFORM directive

Purpose

This directive defines the format of dynamic-format supplied variables. After HCL Workload Automation for Z processes the SETFORM directive, you can refer to the variable and perform arithmetic calculations using the variable. You can redefine the variable many times within the job, if you need to.

Syntax


1  //*%OPC SETFORM  dynamic-variable-name =(  format )

Parameters

dynamic-variable-name=(format expression)
The dynamic variable uses the format defined in the format expression.

Usage Notes

The dynamic variable name must be one of the supplied dynamic variables (see Dynamic-format date-related supplied variables).

The format expression can contain a combination of time-related keywords, date-related keywords, and delimiters.

The date-related keywords are:
CC
Represents the century. This is used in combination with YY to define the format of a full year, such as 1997.
YY
Represents the last two figures in the year.
MM
Represents the month.
DDD
Represents day-in-year. This is substituted before DD: the character string DDDDDD is understood as two DDD keywords, not three DD keywords.
DD
Represents the day in the month.
The time-related keywords are:
HH
Represents the hour.
MM
Represents the minutes.

Any other characters in the format expression are regarded as delimiters. These delimiters can be alphabetic, numeric, or any symbol except the HCL Workload Automation for Z variable substitution characters &, %, ?, =, and the parentheses ().

For the time-related dynamic variables, OCTIME, OPIATIME, OPLSTIME, and CTIME, only HH and MM are recognized. YY, for example, is not substituted. MM is substituted by the minutes part of the time.

For date-related dynamic variables, only CCYY, YY, MM, DD, and DDD are recognized. CC without YY is not recognized. HH is not substituted. MM is substituted by the month part of the date.

You can use more than one delimiter between keywords.

For example, MM//DD-- YY is a valid format expression.

Delimiters are optional; that is, you can define consecutive keywords with no delimiters, such as DDMMYY.

If the expression includes dynamic-format supplied variables containing the first or the last day in the month or in the year of the occurrence IA, the calculated date must fall within the range of four years earlier and seven years later than the current year. For example, if the current year is 1997, the resulting date of the temporary variable must be later than 92/12/31 and earlier than 05/01/01.

In the following examples, assume that the occurrence input arrival time is at 4:10 PM on December 31st 1997.

Example

//*%OPC SCAN
//*%OPC SETFORM OCDATE=(YY/MM/DDD)

The resulting &OCDATE variable would be: 97/12/365

The examples in Dynamic-format substitution results use the same occurrence input arrival date.

Table 1. Dynamic-format substitution results
Dynamic format variable Format expressionResult
OCDATEYY-MM-DDABC 97-12-31ABC
OCTIMEHH MM16 10 (Note the MM substitutes as minutes for time variables and substitutes as month for date variables.)
OCDATEDDDDD36531. DDD is the 365th day of the year, and DD is the day of the month.
OCDATEDDDD 365D. DDD is the 365th day of the year, but no match was found for the last D.
OCDATEYYMMHHMMSS 9712HH12SS. This is a date variable, so HH is not substituted.