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
DESCRIPTION COBOL DD:FILEDESC
AS FILE_DESC;
DATASTORE DD:FILEIN
OF BINARY
AS FILE_IN
DESCRIBED BY FILE_DESC;
Example – Multiplatform
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
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
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/fileout.dat
OF BINARY
AS FILE_OUT
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
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
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;