DESCRIPTION and DATASTORE Command Relationship |
Scroll |
Datastore definition commands have certain relationships with each other, depending on the datastore type defined. Each of these relationships and their application to certain datastore types, are described below.
One-to-One Relationship
DESCRIPTION commands have a one-to-one relationship with DATASTORE commands when a datastore contains a record type that is different from the record type of every other datastore.
Example – z/OS
The following example illustrates a one-to-one DESCRIPTION to DATASTORE command relationship. The datastore is a z/OS binary flat file that is described by a COBOL copybook.
DESCRIPTION COBOL DD:FILEDESC
AS FILE_DESC;
DATASTORE DD:FILEIN
OF BINARY
AS FILE_IN
DESCRIBED BY FILE_DESC;
Example – Multiplatform
This example illustrates a one-to-one DESCRIPTION to DATASTORE command relationship in the Multiplatform (non z/OS) environment. The datastore is a binary flat file that is described by a C header.
DESCRIPTION CSTRUCT /users/sqdata/filein.h
AS FILE_DESC;
DATASTORE /users/sqdata/filein.dat
OF BINARY
AS FILE_IN
DESCRIBED BY FILE_DESC;
One-to-Many Relationship
DESCRIPTION commands can have a one-to-many relationship with DATASTORE commands when the same record layout can be found in more than one (1) datastore. This is commonly used if your source and target datastore are the same format. In this case, you would use a single DESCRIPTION for both your source and target DATASTORES as illustrated below.
Example – z/OS
The following example illustrates a one-to-many DESCRIPTION to DATASTORE command relationship in the z/OS environment. Both the source and target datastores are z/OS binary flat files and are described by the same COBOL copybook.
DESCRIPTION COBOL DD:FILEDESC
AS FILE_DESC;
DATASTORE DD:FILEIN
OF BINARY
AS FILE_IN
DESCRIBED BY FILE_DESC;
DATASTORE DD:FILEOUT
OF BINARY
AS FILE_OUT
DESCRIBED BY FILE_DESC;
Example – Multiplatform
This example illustrates a one-to-many DESCRIPTION to DATASTORE command relationship in the Multiplatform environment. The source and target datastores are both binary flat files that are described by the same C header.
DESCRIPTION CSTRUCT /users/sqdata/filein.h
AS FILE_DESC;
DATASTORE /users/sqdata/filein.dat
OF BINARY
AS FILE_IN
DESCRIBED BY FILE_DESC;
DATASTORE /users/sqdata/filein.dat
OF BINARY
AS FILE_IN
DESCRIBED BY FILE_DESC;
Many-to-One Relationship
This is for datastores that contain multiple record types (each with a different layout), more than one DESCRIPTION commands must be specified to describe the record layouts that reside in that datastore.
Example – z/OS
The following example illustrates a many-to-one DESCRIPTION to DATASTORE command relationship. The datastore is an IBM MQ on z/OS that contains records with multiple formats. The formats are each described by a COBOL copybook.
DESCRIPTION COBOL DD:FILEDSC1
AS FILE_DESC_1;
DESCRIPTION COBOL DD:FILEDSC2
AS FILE_DESC_2;
DATASTORE MQS:///QUEUE_IN
OF BINARY
AS QUEUE_IN
DESCRIBED BY FILE_DESC_1
,FILE_DESC_2;
Example – Multiplatform
This example illustrates a many-to-one DESCRIPTION to DATASTORE command relationship in the Multiplatform environment. The datastore is an IBM MQ that contains records with multiple formats. The formats are each described by a C header.
DESCRIPTION CSTRUCT /users/sqdata/filein1.h
AS FILE_DESC_2;
DESCRIPTION CSTRUCT /users/sqdata/filein2.h
AS FILE_DESC_2;
DATASTORE MQS:///QUEUE_IN
OF BINARY
AS QUEUE_IN
DESCRIBED BY FILE_DESC_1
,FILE_DESC_2;