Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

REPOSITORY paragraph

The REPOSITORY paragraph defines the class and interface names that may be used within the scope of the corresponding Environment Division.

Format


REPOSITORY.
[{  CLASS class-name-1

       [EXPANDS class-name-2 USING {class-name-3 | interfacename-3}... ]

  | INTERFACE interfacename-1

       [EXPANDS interfacename-2 USING {class-name-4 | interfacename-4}... ]

 }... .
]

 


Syntax rules

  1. If class-name-1 is identical to the name of the class definition in which the REPOSITORY paragraph is specified, this entry is ignored.

  2. If interfacename-1 is identical to the name of the interface definition in which the REPOSITORY paragraph is specified, this entry is ignored.

  3. If program-prototype-name-1 is identical to the name of the program definition in which the REPOSITORY paragraph is specified, this entry is ignored.

  4. In COBOL Standard 2002 the EXPANDS phrase is forbidden within a class or interface definition which uses the USING clause in its ID paragraph. However, this compiler permits another nesting level for the EXPANDS phrase. To avoid name conflicts and to ensure clarity and portability of such programs, this nesting should only be used when there is proper justification.

  5. class-name-2, class-name-3 and interfacename-3 must be defined in the same REPOSITORY paragraph as class-name-1.

  6. class-name-4, interfacename-4 and interfacename-2 must be defined in the same REPOSITORY paragraph as interfacename-1.

  7. class-name-2 and interfacename-2 may only be referenced in an EXPANDS phrase.

  8. The expansion of a parameterized class may not be used either directly or indirectly as a current parameter of the same parameterized class.

  9. The expansion of a parameterized interface may not be used either directly or indirectly as a current parameter of the same parameterized interface.

General rules

  1. Within a class/interface definition no class/interface names may be specified in the REPOSITORY paragraph which either directly or indirectly reference the currently defined class in their REPOSITORY paragraph.

  2. class-name-1 is the class name which applies for the entire source unit containing the relevant Environment Division.

  3. interfacename-1 is the interface name which applies for the entire source unit containing the relevant Environment Division.

  4. program-prototype-name-1 is the program prototype name which applies for the entire source unit containing the relevant Environment Division.

  5. If there is no EXPANDS phrase, then data must be contained in the external repository which defines class-name-1/interfacename-1.

  6. If a program prototype exists for program-prototype-name-1 in the compilation group, the use of this prototype definition depends on the control of repository access (see the "COBOL2000 User Guide" [1]).

  7. class-name-3 and interfacename-3 are the current parameters of the parameterized class class-name-2.

  8. class-name-4 and interfacename-4 are the current parameters of the parameterized interface interfacename-2.

  9. The number of current parameters in the USING clause must match the number of formal parameters in the USING clause of the CLASS-ID of class-name-2. The specification (as class or interface) of the corresponding current and formal parameters must also match.
    class-name-1 is generated from the parameterized class class-name-2 by replacing all formal parameters with the corresponding current parameters and by replacing class-name-2 with class-name-1.

  10. The number of current parameters in the USING clause must match the number of formal parameters in the USING clause of the INTERFACE-ID of interfacename-1. The specification (as class or interface) of the corresponding current and formal parameters must also match.
    interfacename-1 is generated from the parameterized interface interfacename-2 by replacing all formal parameters with the corresponding current parameters and by replacing interfacename-2 with interfacename-1.