Registering a COBOL Data File That Uses a COBOL Copybook

Problem

You want to create metadata for a COBOL data file that uses column definitions from a COBOL copybook. The copybook is a separate file that describes the structure of the data file.

Solution

Perform the following steps to specify metadata for a COBOL data file in SAS Data Integration Studio:
  1. Use the import COBOL copybook feature to create a COBOL format file from the COBOL copybook file.
  2. Use the External File wizard to copy column metadata from the COBOL format file.

Tasks

Import the COBOL Copybook

Server administrators should perform the following steps, which describe one way to import the COBOL copybook:
  1. Obtain the required set of SAS programs that supports copybook import. Perform the following steps from Technical Support document TS-536 to download the version of COB2SAS8.SAS that was modified for SAS 8:
    1. Go to the Technical Support Web page and download this zipped file: http://ftp.sas.com/techsup/download/mvs/cob2sas8.zip.
    2. Unzip the file into an appropriate directory.
    3. Read the README.TXT file. It contains information about this modified version of COB2SAS8.SAS. It also contains additional information about the installation process.
  2. Click Import COBOL Copybook in the Tools menu for SAS Data Integration Studio to access the Cobol Copybook Location and Options window.
  3. Select a SAS Application Server in the Server field. The selected SAS Application Server must be able to resolve the paths that are specified in the Copybook(s) field and the COBOL format file directory field.
  4. Indicate the original platform for the COBOL data file by selecting the appropriate radio button in the COBOL data resides on field.
  5. Select a copybook file to import in the Copybook(s) field. If you have imported copybooks in the past, you can select from a list of up to eight physical paths to previously selected copybook files. If you need to import a copybook that you have never used in SAS Data Integration Studio, you have two options. First, you can click Add to type a local or remote path manually. Second, you can click Browse to browse for a copybook that is local to the selected SAS Application Server.
  6. Specify a physical path to the directory for storing the COBOL format file in the COBOL format file directory field. You can enter a local or remote path in the field, choose a previously selected location from the drop-down menu, or browse to the file.
  7. Click OK when you are finished. The Review object names to be created window displays.
  8. Verify the name of the COBOL format file or files. Specify a physical path for the SAS log file in the SAS Log field. This file is saved to the SAS Data Integration Studio client machine.
  9. Click OK when you are finished. One or more COBOL format files are created from the COBOL copybook file.
Note: If the external file resides on the MVS operating system, and the filesystem is native MVS, then the following usage notes apply.
  • Add the MVS: tag as a prefix to the name of the COBOL copybook file in the Copybook(s) field . Here is an example filename: MVS:wky.tst.v913.etls.copybook.
  • Native MVS includes partitioned data sets (PDS and PDSE). Take this factor into account when you specify a physical path to the directory for storing the COBOL format file in the COBOL format file directory field . Here is an example path: MVS:dwatest.tst.v913.cffd.
  • The COB2SAS programs must reside in a PDS with certain characteristics. For more information about these characteristics, see http://support.sas.com/techsup/technote/ts536.html.
  • The path to the r2cob1.sas program should specify the PDS and member name. Here is an example  path, which would be specified in the Full path for r2cob1.sas field in the Advanced options window: mvs:dwatest.tst.v913.cob2sasp(r2cob1)

Copy Column Metadata From the COBOL Format File

Perform the following steps to copy column metadata from the COBOL format file in the Column Definitions page of an External File wizard.
  1. Access the Column Definitions page of an External File wizard.
  2. Click Import to access the Import Columns window.
  3. Select the Get the column definitions from a COBOL format file radio button. Then, use the down arrow to select the appropriate COBOL format file and click OK. The column metadata from the COBOL format file is copied into the Column Definitions page.
  4. Specify any remaining column metadata in the Column Definitions page. Click Next.
  5. Click Finish when you are finished. The metadata for the external file is saved to the metadata server.