Rational Programming Patterns

Micropatterns for loading the system date

The ADT and ADC micropatterns load the system date into a constant, and possibly a field indicated in the operands. The AD6 and AD8 micropatterns, which are specific to the OnLine Systems Development and Client/Server functions, load the system date into a field indicated in the operands.

Input format

You must conform to the following input format:
      *{ADX "XXXXXX"
      *}
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.
  • ADX is the micropattern identifier: ADT, ADC,AD6, or AD8.
  • " " must frame the operands.
  • XXXXXX is the operand. It is a field into which the system date is loaded. This operand is optional for ADT et ADC.
  • *} is the required end 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.

ADT and ADC micropatterns

These micropatterns can be inserted in the COBOL code of a Program, Screen, or Server with the PDP COBOL editor, or in the code of a Macro with the PDP Macro editor.

ADT calls the system date without the century. The date is loaded into the DATOR constant and possibly in the field indicated in the operands.

ADC calls the system date with the century. The date is loaded into the DATCE constant and possibly in the field indicated in the operands.

The Generated date format on the Library Definition specifies the format into which the system date will be displayed.

When the instance is generated again, the micropattern generates the:
  • COBOL code corresponding to the micropattern declaration between the start and end tags,
  • Date-related data in the WORKING-STORAGE SECTION.
Note: In COBOL II and COBOL 85, if the year is lower than 61, the century (CENTUR) is automatically set to 20.

AD6 and AD8 micropatterns

These micropatterns can be inserted in the COBOL code of a Screen or Server with the PDP COBOL editor.

AD6 loads the system date into the six-character date entered as the operand. The date is loaded as MMDDYY or DDMMYY, according to the value of the Generated date format on the Library Definition.

AD8 loads the system date into an eight-character date entered as the operand. The date is loaded as MM/DD/YY or DD/MM/YY, according to the value of the Generated date format on the Library Definition.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)