Guidelines for Creating Libraries

Library names follow the same standard as program names. The routine name is all uppercase. A procedural code library file has a suffix of PD, and a working storage library file has a suffix of WS:

ROUTINENAMEPD
ROUTINENAMEWS
  • A library can have multiple routines. Each routine must have a separate section number.

    Note: If a program uses one routine in a library with multiple routines, the entire library is copied into the program.
  • Any work files used in a procedural code library must also be defined for that library.

  • Each procedural routine in the library must have a section heading followed by a paragraph label.

    **************************************************************
           900-EDIT-USER-NAME             SECTION.
    **************************************************************
           900-START.
    
           CALL "EditUserName" USING WS-USER-NAME,CRT-ERROR-NBR.
    
           900-END.
  • All labels in a section must have the same number prefix or Library Definition does not accept it.

  • When you add variables to a new or existing procedural code library routine (pdlib), define all new variables in the associated working storage library file (wslib).