Micropatterns to condition the processing according to dates
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.
*!DCD "xy ffnn-date1 ope ffnn-date2"
- *! 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=.
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.
*!DVD "x ffnn-date1"
- *! 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.
- For the DVD micropattern, the following line
is generated:
IF EN-PRE=’1’
- For the DVF micropattern, the following lines
are generated:
IF EN-PRE=’1’ NEXT SENTENCE ELSE GO TO Fffss-FN
ffss is the function or subfunction that the micropattern applies to.
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.
*!DID "x ffnn-date1"
- *! 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.
- For the DID micropattern, the following line
is generated:
IF EN-PRE>’1’
- For the DIF micropattern, the following lines
are generated:
IF EN-PRE>’1’ NEXT SENTENCE ELSE GO TO Fffss-FN
ffss is the function or subfunction that the micropattern applies to.