These micropatterns condition the execution of the processing
that is associated to a function or subfunction level or a COBOL 99 level
according to tests on dates. You can insert them in the code of a
Program, Screen, Server, or Macro.
Date comparison
The DCF and DCD micropatterns
condition the execution of the processing to the verification of a
comparison between two dates. If the comparison is true (if the first
date is greater than the second date for example), then the processing
is executed. The DCF micropattern applies to a function
or subfunction level. The DCD micropattern applies
to a COBOL 99 level.
The
input format is identical for both micropatterns, except for the micropattern
identifier: *!DCD "xy ffnn-date1 ope ffnn-date2"
where:
- *! is the required start tag of
the micropattern. The * must be entered in column
7, reserved for the comments in the COBOL code, and the ! must
be entered in column 8.
- DCD (or DCF) is the micropattern
identifier.
- " " must frame the operands.
- x is the format of date1 (optional).
If you do not specify it, it will be extracted from the repository
if the Data Element has a date format.
- y is the format of date2 (optional).
If you do not specify it, it will be extracted from the repository
if the Data Element has a date format.
- ffnn-date1 and ffnn-date2 are
the two dates of the comparison.
- ope is the comparison type, among the following
types: >, <, >=, <=, NOT>, NOT<, NOT=.
When the Program, Screen, or Server is generated again,
the micropattern is recognized. Dates are transformed in order to
be compared. Moreover, the following line is generated for the
DCF micropattern
only:
NEXT SENTENCE ELSE GO TO Fffss-FN.
ffss is the function or subfunction that
the micropattern applies to.
Date validity
The DVF and DVD micropatterns
condition the execution of the processing to the validity of a date.
If the date is valid, then the processing is executed. The DVF micropattern
applies to a function or subfunction level. The DVD micropattern
applies to a COBOL 99 level.
The
input format is identical for both micropatterns, except for the micropattern
identifier: *!DVD "x ffnn-date1"
where:
- *! is the required start tag of
the micropattern. The * must be entered in column
7, reserved for the comments in the COBOL code, and the ! must
be entered in column 8.
- DVD (or DVF) is the micropattern
identifier.
- " " must frame the operands.
- x is the format of date1 (optional).
If you do not specify it, it will be extracted from the repository
if the Data Element has a date format.
- ffnn-date1 is the date Data Element to validate.
When the Program, Screen, or Server is generated
again, the micropattern is recognized. The F95ER subfunction
is generated for the errors.
Moreover, other lines are generated
so that the dependent processing is executed:
Date invalidity
The DIF and DID micropatterns
condition the execution of the processing to the invalidity of a date.
If the date is invalid, then the processing is executed. The DIF micropattern
applies to a function or subfunction level. The DID micropattern
applies to a COBOL 99 level.
The
input format is identical for both micropatterns, except for the micropattern
identifier: *!DID "x ffnn-date1"
where:
- *! is the required start tag of
the micropattern. The * must be entered in column
7, reserved for the comments in the COBOL code, and the ! must
be entered in column 8.
- DID (or DIF) is the micropattern
identifier.
- " " must frame the operands.
- x is the format of date1 (optional).
If you do not specify it, it will be extracted from the repository
if the Data Element has a date format.
- ffnn-date1 is the date Data Element to validate.
When the Program, Screen, or Server is generated
again, the micropattern is recognized. The F95ER subfunction
is generated for the errors.
Moreover, other lines are
generated so that the dependent processing is executed: