Example 1: Sequential (binary) Files - Multiplatform
Define a datastore layout using a COBOL copybook in file employee.cob. Define the source datastore file employee.inp and a target datastore file employee.out that each use the definition described in employee.cob.
DESCRIPTION COBOL /home/sqdata/COBOL/employee.cob
AS EMPLOYEE;
DATASTORE /home/sqdata/employee.inp
OF BINARY
AS EMPLOYEE_IN
DESCRIBED BY EMPLOYEE;
DATASTORE /home/sqdata/employee.out
OF BINARY
AS EMPLOYEE_OUT
DESCRIBED BY EMPLOYEE;
Example 2: z/OS Sequential (binary) Files
Duplicate the previous example, using the definition of a datastore layout and the definition of the source and target datastores on the z/OS platform. The datastore layout is in a COBOL copybook EMPLOYEE referenced by DDNAME COBLIB. The source and target datastores are referenced by DDNAMEs EMPIN and EMPOUT, respectively.
DESCRIPTION COBOL DD:COBLIB(EMPLOYEE)
AS EMPLOYEE;
DATASTORE DD:EMPIN
OF BINARY
AS EMPLOYEE_IN
DESCRIBED BY EMPLOYEE;
DATASTORE DD:EMPOUT
OF BINARY
AS EMPLOYEE_OUT
DESCRIBED BY EMPLOYEE;
Note: The two examples are identical, except for the specification of a directory path vs a JCL DD Name in the z/OS example.