Code customization
When you check the Generate COPY statement for customization box in the Code generation dialog box, IBM® InfoSphere® DataStage® provides four places in the generated COBOL program that you can customize.
You can add code to be executed at program initialization or termination, or both. However, you cannot add code that would affect the row-by-row processing of the generated program.
When you check Generate COPY statement for customization, four additional COPY statements are added to the generated COBOL program:
- COPY ARDTUDAT. This statement is generated just before the PROCEDURE DIVISION statement. You can use this to add WORKING-STORAGE variables or a LINKAGE SECTION to the program.
- COPY ARDTUBGN. This statement is generated just after the PROCEDURE DIVISION statement. You can use this to add your own program initialization code. If you included a LINKAGE SECTION in ARDTUDAT, you can use this to add the USING clause to the PROCEDURE DIVISION statement.
- COPY ARDTUEND. This statement is generated just before each STOP RUN statement. You can use this to add your own program termination code.
- COPY ARDTUCOD. This statement is generated as the last statement in the COBOL program. You use this to add your own paragraphs to the code. These paragraphs are those which are PERFORMed from the code in ARDTUBGN and ARDTUEND.
InfoSphere DataStage provides default versions of these four COPYLIB members. As provided, ARDTUDAT, ARDTUEND, and ARDTUCOD contain only comments, and ARDTUBGN contains comments and a period.
You can either preserve these members and create your own COPYLIB, or you can create your own members in the InfoSphere DataStage runtime COPYLIB. If you preserve the members, then you must modify the InfoSphere DataStage compile and link JCL templates to include the name of your COPYLIB before the InfoSphere DataStage runtime COPYLIB. If you replace the members in the InfoSphere DataStage COPYLIB, you do not need to change the JCL templates.