Implement IDMS Copybook Support Through the COBOL Language Support Extension

To use the IDMS copybook support offered by the COBOL Language Support extension, you must do several things: extract (punch) the IDMS entities to a PDS member in IDMS copybook format, transfer the IDMS copybooks to your local workspace, and configure your workspace to point to their location.  
Prerequisite
Before performing the procedure that follows, review the IDMS Copybook Support Considerations to understand the scope of the support provided by the VSCode extension. Follow the guidelines presented in the topic for best results when using the IDMS copybook support.
Extract (Punch) an IDMS Copybook
Extract the IDMS entities to a PDS member in IDMS copybook format.
Follow these steps:
  1. Review the JCL instructions in the "z/OS JCL" section of the topic DML Precompile, COBOL Compile, and Link Edit JCL. Also refer to the z/OS JCL sample included in the topic.
  2. Modify the SYSPCH statement in the IDMSDMLC step to specify the PDS and member for output:
    SYSPCH DD DSN=
    userlib
    (
    membername
    ), DISP=SHR
    • userLib
      A previously allocated PDS
    • membername
      The name of the copybook on the mainframe, which is limited to eight characters (the limit for any PDS member)
      Example: Modify the SYSPCH statement to output IDMS.COPYBKS(SSCTRL)
      The following example shows the SYSPCH statement of the IDMSDMLC step, which has been modified to output an IDMS-entity (named SUBSCHEMA-CTRL) to a PDS and member. In the example, the PDS is IDMS.COPYBKS, and the member name is SSCTRL.
      //SYSPCH DD DSN=IDMS.COPYBKS(SSCTRL),DISP=SHR
      Because PDS member names have an eight-character limit, you might have to shorten the file names during this step. However, after you have transferred the files to your PC, you can change the names back to the original names. To use the IDMS copybooks after you download them, their names must match the COPY IDMS statement names.
  3. Run only the PRECOMPILE COBOL PROGRAM step (IDMSDMLC).
  4. The COBOL DML source statements (see SYSIPT DD) are the COPY IDMS statements with any supporting statements (either inline or in a file).
    For example, to create an IDMS copybook for any COPY IDMS that is subschema-related, the SCHEMA SECTION, including the DB statement, must precede the COPY IDMS statement. To create an IDMS copybook for any COPY IDMS that is MAP-related, the MAP SECTION, including the MAP statements, must precede the COPY IDMS statement.
    Run this job using the dictionary that you want the precompiler to access. For more information, see the dictionary specification in the DML Reference for COBOL. See the topic DML Precompile, COBOL Compile, and Link-edit JCL (specifically refer to the "Passing Parameters to the Precompiler" section).
    Example: Create an IDMS copybook for SUBSCHEMA-RECORDS
    The following example shows the input to the precompile step (the preceding steps 1-3).
    SCHEMA SECTION. DB EMPSS01 WITHIN EMPSCHM VERSION 100. COPY IDMS SUBSCHEMA-RECORDS.
    The following example is an abbreviated version of the output.
    *SCHEMA SECTION. *DB EMPSS01 WITHIN EMPSCHM VERSION 100. *COPY IDMS SUBSCHEMA-RECORDS. 01 STRUCTURE. 02 STRUCTURE-CODE-0460 PIC X(2). 88 ADMIN-0460 VALUE 'A' . 88 PROJECT-0460 VALUE 'P1' THRU 'P9' . 02 STRUCTURE-DATE-0460. 03 STRUCTURE-YEAR-0460 PIC 9(4). 03 STRUCTURE-MONTH-0460 PIC 9(2). 03 STRUCTURE-DAY-0460 PIC 9(2). 02 FILLER PIC XX. 02 FILLER PIC X(4). 01 SKILL. 02 SKILL-ID-0455 PIC 9(4). 02 SKILL-NAME-0455 PIC X(12). 02 SKILL-DESCRIPTION-0455 PIC X(60). 02 FILLER PIC X(4).
Store the IDMS Copybooks Locally
After extracting the IDMS copybooks to a PDS, store them locally by downloading them to folders in your workspace.
Follow these steps:
  1. Transfer the mainframe data sets to a local folder on your PC using your preferred transfer method, such as FTP or Zowe Explorer.
  2. When the files are on your PC, if you shortened the names of the IDMS statements referenced in your programs, change the names back to their original names. For example, if during the extract process you renamed an IDMS-entity that is called SUBSCHEMA-CTRL to SSCTRL, rename SSCTRL to SUBSCHEMA-CTRL.
Configure Your Workspace to Locate the IDMS Copybook Files
In the workspace settings, specify the paths to the folders and data sets that contain the IDMS copybooks that are used in your project.
Follow these steps:
  1. Open the COBOL Language Support extension settings. Select the
    Extensions
    tab, click the cog icon next to
    COBOL Language Support
    , and select
    Extension Settings
    .
  2. Switch from
    User
    to
    Workspace
    .
  3. Under
    Cpy-manager: Paths-local
    , specify the paths to the folders that contain the IDMS copybooks. To obtain the relative path of a folder in your workspace, right-click it in the folder tree and select
    Copy Relative Path
    .
    Tip:
    Specify relative paths from the workspace root so that the folders containing the copybooks are watched for changes. If absolute paths or paths that contain ../ or ./ are used to specify the copybook folders, the copybook folders are not watched for changes.
    Folders are searched in the order they are listed. For example, if two folders contain an IDMS copybook with the same file name, the IDMS copybook file from the folder higher on the list is used.
  4. Open a program or project and use the IDMS copybook support features that you have enabled.