Required Copy Files

Each application program that uses RM/Panels requires the master copy file RMPANELS.WS.

Note In some situations you may wish to use one of the other versions of RMPANELS.WS (RMPANELS.LNK and RMPANELS.EXT). See Appendix A, Master Copy File RMPANELS.WS for details on using these copy files.

RMPANELS.WS must be copied into the Working-Storage Section of the application program. The master copy file contains a parameter block used to pass parameters between the application program and the RM/Panels run-time system. Appendix A contains a complete description of RMPANELS.WS.

Each application program must also contain a pair of panel-specific copy files for each panel it uses. These two copy files are the interface between your application program and the RM/Panels run-time system. The Panel Editor automatically produces these copy files when you create a panel. The copy files are named with the first eight characters of the panel name, followed by the extensions, .WS and .PRC. For example, a program that used a panel named MYPANEL would require the copy files:

These panel-specific copy files are described below, with MYPANEL representing the panel name variable.

MYPANEL.WS

MYPANEL.WS sets up a 100-byte work area for the panel that never needs to be directly modified or referenced by your application program. This work area exists solely for the use of RM/Panels.

MYPANEL.WS also contains declarations for each field/control on the panel. This area is called MYPANEL-WS. These fields are declared in the same manner as any other data item in the Working-Storage Section of a COBOL program. These field declarations are used both as the source of field/control values for RM/Panels displays and as the destination for RM/Panels accepts. The order of these fields/controls is dictated by the Panel Configuration and should not be changed manually. Values, however, can be moved in or out of the fields/controls at any time.

MYPANEL.WS must be copied into the Working-Storage Section of your application program.

Example of contents of MYPANEL.WS:

01MYPANEL-WS.
  03 FILLER      PIC X(100) VALUE "MYPANEL    0050".
  03 CUST-CITY   PIC X(15).
  03 CUST-NAME   PIC X(30).
  03 CUST-NUMBER PIC 9(5).

MYPANEL.PRC

MYPANEL.PRC contains procedures that execute RM/Panels standard run-time functions, such as displaying or removing panels and entering panel fields/controls. MYPANEL.PRC must be copied into the Procedure Division of your application program.

Example of partial contents of MYPANEL.PRC:

RMP--AF-MYPANEL.
     CALL RMP--RUNTIME USING RMP--AF 
     RMP--PARAMETERS MYPANEL-WS
RMP--EE-MYPANEL.
     CALL RMP--RUNTIME USING RMP--EE 
     RMP--PARAMETERS MYPANEL-WS

Sample Program

The following sample program shows the minimum requirements for an RM/Panels program. This program, which displays a panel and then removes it, is called MINIMUM. It uses a panel called MYPANEL in the panel library called MYPANEL.LIB.

IDENTIFICATION DIVISION. 
PROGRAM-ID. MINIMUM. 
ENVIRONMENT DIVISION. 
DATA DIVISION.
WORKING-STORAGE SECTION.
  COPY "RMPANELS.WS". 
  COPY "MYPANEL.WS".
PROCEDURE DIVISION. 
MAIN-PROCEDURE.
  MOVE "MYPANEL.LIB" TO RMP--LIBRARY. 
  PERFORM RMP--DP-MYPANEL.
  PERFORM RMP--RP-MYPANEL. 
  STOP RUN.

  COPY "MYPANEL.PRC".