Used for Batch Migration
The PUNCH statement of the schema, subschema, and DDDL compilers and command facility is useful for batch migrations. If you perform the migration in batch mode, the PUNCH statement allows you to migrate larger volumes of information. It also allows you to migrate between dictionaries under the control of different DC/UCF systems.
Writes Information to File or Module
The PUNCH statement has the same options as the DISPLAY statement. However, it writes the requested information to one of two destinations: an external file or an IDD module.
Use Files or Modules to Accumulate Large Numbers of Components
The file or module provides an intermediate place to store the information you want to migrate. As a result, you can:
Technique 1
This technique is very similar to the technique for the DISPLAY statement described above. Because it occurs in batch, however, you can migrate larger volumes of information.
Steps
The steps in this technique follow:
In the PUNCH statement, use the AS SYNTAX clause. In addition, specify VERB MOD if you are migrating existing components. Define the file as SYSPCH in the JCL.
To avoid having to specify these clauses in every PUNCH statement, you can issue a SET OPTIONS statement before the PUNCH statements:
set options display as syntax verb mod.
set options input 1 thru 80.
This step prepares for the task of compiling the components from the temporary file into the target dictionary. Be sure the SIGNON and SET OPTIONS statements start between columns 1 and 72.
The compiler signs on the target dictionary and adds or modifies the components in the file.
Technique 2
With this technique, you create a dictionary module in the source dictionary to hold the components you want to migrate. You migrate the module to the target dictionary, extract the ADD or MODIFY statements for the individual components, and store or modify each of the components in the target dictionary.
Steps
The steps in this technique follow:
add module holdit.
punch element emp-last-name to module holdit as syntax.
The module source for HOLDIT now consists of the ADD ELEMENT EMP-LAST_NAME statement.
You can perform this step in batch or online mode, and you can punch more than one component to the module. If you use the SET OPTIONS statement following signon, your input appears as follows:
set options input 1 thru 80
default is on
punch to module holdit
as syntax.
punch element emp-last-name.
.
.
.
This statement automatically changes an ADD to MODIFY if the entity already exists in the dictionary and punches the entity as syntax.
The input to the compiler consists of only two statements: a SIGNON statement for the source dictionary and a PUNCH statement for the module. In the PUNCH statement, use the AS SYNTAX and TO SYSPCH clauses. Also, be sure to define the file as SYSPCH in the JCL.
At the end of this step, the external file contains only one statement: an ADD/MODIFY MODULE statement. Within the MODULE statement, however, the module source consists of the ADD or MODIFY statement for the individual components that you want to migrate.
set options input 1 thru 80.
As a result of the editing, the external file contains four statements:
For example:
signon user dba password pass dictname target. set option input 1 thru 80. add module holdit . . . module source follows add element emp-last-name version is 1 pic is x(20) . . . msend. include module holdit.
The compiler signs on to the target dictionary and adds or modifies the module. The INCLUDE statement brings the module source into the compiler's work file. The content adds or modifies the individual components to the target dictionary.
Final Tasks for Schemas and Load Modules
As with the DISPLAY statement, the PUNCH statement does not automatically validate the schemas or generate the load modules for subschemas and edit/code tables. To perform these function, use one of the methods described earlier in 26.6.1, "Using the DISPLAY statement".
Technique 3
This technique combines parts of the Technique 2 presented above and parts of the online DISPLAY technique described earlier in 26.6.1, "Using the DISPLAY statement". Because this technique entails an online migration, you need to moderate the volume of information you punch.
The steps in this technique follow:
As above, direct the output of the punch to the module by including the TO MODULE clause in each PUNCH statement or in a SET OPTIONS statement. Also, specify the AS SYNTAX clause and the VERB ADD or VERB MODIFY clause, as appropriate.
This step brings the module (with all of its source) into the compiler's work file. In the DISPLAY statement, use the AS SYNTAX clause.
This step prepares the work file for the task of compiling the module and then the components into the target dictionary. As a result of the editing, the work file contains three statements:
The compiler signs on to the target dictionary and adds or modifies the module. The INCLUDE statement brings the module source into the compiler's work file and executes the content of the work file. The content adds or modifies the individual components to the target dictionary.
Final Steps for Schemas and Load Modules
As with the other techniques, this technique does not automatically validate schemas or generate load modules for subschemas and edit/code tables. To perform these functions, use one of the methods described earlier in 26.6.1, "Using the DISPLAY statement".
|
Copyright © 2014 CA.
All rights reserved.
|
|