*DM COPY TABLE [NAME IS] x-----------------------------x
*DM [USING
*DM {ELEMENT NAME IS list |
*DM DATAVIEW NAME IS name
*DM VERSION {PROD|TEST} nnn |
*DM |Tnnn
*DM ALL ELEMENTS |
*DM AUTO MAPPING }
*DM OVER-RIDE xxxx
*DM KEY NAME IS x-------------x
*DM OLD NAME x------------------------------x
*DM SUPPRESS
*DM INCREMENT-SEQ xx]. -
-
-any field generators go here (sequence numbers required in columns
73-80)
-
*DM END-COPY.
The format II COPY TABLE statement copies the record descriptions from the primary Datadictionary or the alternate Datadictionary, specified on the DATACOM statement by DDID and builds a copybook conforming to the rules of COBOL. One COPY TABLE statement is coded for each table needed. The keyword TABLE and the table name must follow the word COPY. The NAME IS keyword is optional and may be used for readability. Identify the table by using the 1-to-32 byte occurrence name.
Four options are available to indicate to CA-Datamacs/II which elements will be used to build the copybook.
The USING ELEMENT option allows individual element occurrence names to be specified in a list format. Each occurrence name entered should be separated with a comma. They can be continued on the next line by placing a comma after the last name on the previous line. Only those elements defined to the database name and status/version specified on the DATACOM statement will be retrieved from Datadictionary, to be matched against the list entered. As many element names as needed may be entered.
The DATAVIEW keyword will copy just the fields defined to each element related to the DATAVIEW name and status/version entered. Only one DATAVIEW name can be entered, per *DM COPY TABLE statement. A check is done to ensure the DATAVIEW is related to the database name and status/version specified on the DATACOM statement.
The VERSION keyword identifies which version of the DATAVIEW should be used and its status (for example, Production or Test). If not entered, the latest production version will be used.
The next two options can be used depending on how the elements are defined in the database.
The ALL ELEMENTS option may be used if the total length of all the elements defined to the database, as specified in the DATACOM statement, matches the total width of the table (MAX-RECORD-SIZE). CA-Datamacs/II will automatically build a copybook containing all the fields defined to the table.
The AUTO MAPPING option may be used if the MAX-RECORD-SIZE reflects the actual table width and one or both of the following conditions are met:
In either case, a copybook is automatically built containing all the fields defined to the database.If one out of the four options is not entered, it will default to AUTO MAPPING.
A final test is performed by CA-Datamacs/II to insure that no selected elements overlap each other.
The KEY NAME IS keyword declares the default key occurrence name for the table to be automatically used by any READ or EQUI-JOIN command that does not have a key occurrence name coded. The freedom exists to use any key occurrence name on a READ or EQUI-JOIN, regardless of what is coded here. If the key name is omitted here and on the READ or EQUI-JOIN command, then the master key occurrence name is used as a default. Compound keys will be supported. Using this keyword simply saves you the effort of coding it in each database access command (for example, READ or EQUI-JOIN). Any key occurrence name specified in Datadictionary can be specified at any time. NAME IS is optional.
The OLD NAME entry is used on a LOAD function if the table name has changed since the UNLOAD function was done. The UNLOAD function places control records in the output file which contain the table name. These are used during the subsequent LOAD to find the appropriate COPY TABLE statement and thus obtain the table name. Of course, the data fields in the input file must match the new table record definition.
The optional SUPPRESS keyword will prevent the field description from printing.
For CREATE, LOAD, and MODIFY, place the field generator statements after the COPY TABLE statement and before an END-COPY statement.An END-COPY statement must be placed after any field generators and prior to the next COPY TABLE statement or the PROCEDURE DIVISION.
The field generators must contain a line sequence number allowing CA-Datamacs/II to merge the field generator with the correct field, as it is copied from Datadictionary. The line sequence numbers are built by placing the table's DATACOM-ID in the leftmost 3 positions, followed by a sequential number starting with 00060 and incremented by the value in INCREMENT-SEQ, in the rightmost 5 positions. The sequence number for a field will print in columns 73 to 80 as the fields are copied from Datadictionary. This listing can be obtained by doing a SYNTAX only run and omitting the SUPPRESS option. The default increment between line sequence numbers is 10. This can be changed with the INCREMENT-SEQ option by specifying a number up to 99. The range of the sequence number determines how many field generators can be attached to one field. INCRE is the abbreviation for this option. Using the ISPF front-end makes this line sequence number process transparent to the user. A period must end the COPY TABLE statement.
| Copyright © 2009 CA. All rights reserved. | Tell Technical Publications how we can improve this information |