CMP_TIME

Figure 1. CMP_TIME syntax – with template

1 CMP_TIME(
2.1 #nn(subscript)
2.1 fieldname(subscript)? ,imask? ,omask
1! ‘EQ’
1 ‘operator’
2 ,
2 + , value
2 ?,tally_literal)
Figure 2. CMP_TIME syntax – without template

1 CMP_TIME(start, length, type, imask,  omask
1! ‘EQ’
1 ‘operator’
2 ,
2 + , value
2 ?,tally_literal)

(Can be used in FASTREXX condition expressions.)

CMP_TIME is a Boolean function which can be run with or without a template. It enables you to perform a conditional test against time values in a field.

Note:
  1. If the field is defined as a date and time field in the template, imask and omask do not need to be specified as File Manager will take these values from the template.
  2. The Field name (fieldname), field reference (#nn), operator (operator), and non-numeric values should all be enclosed in quotation marks to avoid syntax errors.
  3. Commas following the last specified argument can be omitted.
#nn or fieldname
#nn
Use this form when providing free-format criteria during template edit. nn is the field reference number displayed during template edit. It is not valid to use fieldname for a field reference when providing criteria during template edit.
fieldname
Use this form of identifying fields when coding user procedures. For non-unique names, you can specify a name in the form groupname.dataname. Name matching is not case-sensitive. If the name is unqualified, then the first occurrence of the name is used. Do not code #nn values in user procedures, as the displayed field reference values do not identify the correct field when running from a user procedure.
subscript
This applies only to dimensioned fields. You can specify one of these forms:
(ANY)
This is the default if you do not specify a subscript for a dimensioned field and it indicates that at least one element of the associated array must satisfy the condition for a true result.
(ALL)
This indicates that all elements of the associated array must satisfy the condition for a true result.
(nn)
This refers to a single array element and you should provide a valid subscript for the dimensioned field.
start
Position, in bytes, in the input record at which to start reading the field value. Can be specified as:
Absolute position
Must be a positive integer. Default value is 1. If start is greater than the current length of the input record, the function has no effect.
Relative to current INPOS
Can be specified as IPx or INx, or as Px or Nx. If this resolves to a value of less than or equal to zero or greater than the current length of the input record, the function has no effect.
Relative to current OUTPOS
Must be specified as OPx or ONx. If this resolves to a value of less than or equal to zero or greater than the current length of the input record, the function has no effect.
length
The length of the field in bytes.

For binary fields, either omit the length or specify 4.

For packed decimal fields, if you specify the length, it must be in the range 1–16. If you omit the length, CMP_TIME attempts to determine the packed field length from the record data and returns only that field.

For zoned decimal fields the length must be in the range 1-32.

type
The data type of the field. Valid values are:
B
Binary.
C
Character. This is the default.
P
Packed decimal.
B
Zoned decimal.
imask
A value or picture string that defines the format used to store the date in the field. For a picture string, File Manager supports all pictures described in the z/OS® Language Environment® Programming Services, Appendix B, "Date and time services tables".

File Manager also supports specifying one of the following values:

CENTSECS
Time of day in hundredths of seconds.
MICSECS
Time of day in millionths of seconds.
MILLSECS
Time of day in thousandths of seconds.

An imask value must be available for File Manager to use. If a template is used and imask is not specified, File Manager uses the internal mask saved in the template.

omask
A picture string that describes the format used for the date values passed as parameters to CMP_TIME. File Manager supports all pictures described in the z/OS® Language Environment® Programming Services, Appendix B, "Date and time services tables".

An omask value must be available for File Manager to use. If a template is used and omask is not specified, File Manager uses the output mask saved in the template.

operator
The default is EQ or =. This function supports all the operators described for dynamic template and criteria edit. For details about the operators supported and their description, see:
value
The value or values must be valid in the context of the operator and the field which is being referenced. For example, only certain operators like CO (contains) allow multiple values. The format of a value must be a based on the date format described by omask.
tally_literal
Specify a literal to appear on a tally report that counts every true result from the CMP_TIME function.

Example 1

Process only those records with a START-TIME value after midday.


IF CMP_TIME('START-TIME',MILLSECS,'HH:MI:SS.999','GT','12:00:00.000')
THEN
  RETURN
ELSE
  RETURN 'DROP'