Binder Manual (G06.27+, H06.04+, J06.03+)

Using Binder
Binder Manual528613-004
2-15
Binding SQL Program Files
and does not include the second (and old) copy of the entry points, code blocks, or
RTDUs.
The following example also works by specifying the file containing the new
procedures first:
In this example Binder places the code blocks from SQLFILE on the include list
and the corresponding data blocks and RTDUs on the unresolved reference lists. It
also notes that the data blocks and RTDUs can be resolved from SQLFILE. After
the BUILD command, Binder then resolves the references to the data blocks and
RTDUs from SQLFILE.
3. Add everything from the old file, then replace the SQL code blocks and everything
associated with them. For example:
The REPLACE * command places the code blocks, data blocks, and RTDUs from
SQLFILE onto the include lists.
This method causes potential memory problems. Binder names data blocks using
the timestamp from the compilation. Therefore, the data blocks in OLDFILE and
SQLFILE have different names. The REPLACE command cannot replace the data
blocks added with the first command because they have different names from the
data blocks referenced in the REPLACE command. REPLACE cannot replace
something that is not there. Because the new data blocks are referenced by the
new procedure code, Binder puts the new data blocks on the unresolved reference
list and resolves the reference to the data blocks from SQLFILE after a BUILD
command. NEWFILE then contains both the old data blocks and the new data
blocks. If you use this method, you will eventually run out of data space.
In the previous example, a REPLACE CODE command would not work. REPLACE
CODE would add the new code blocks to the include list and place references to the
data blocks and RTDUs on the unresolved reference lists. After a BUILD command,
Binder would then resolve the references to the data blocks, giving you both the old
and new data blocks, but it would resolve the references to the RTDUs from OLDFILE.
Therefore, NEWFILE would not include the correct RTDUs.
Note. Specifying ADD * FROM OLDFILE as the second command would require
overhead for the same reason as the command sequence in method #3. See method #3
for a detailed explanation.
@ADD CODE * FROM sqlfile
@ADD CODE * FROM oldfile
@BUILD newfile!
Note. The previous example does not work if you transpose the two ADD commands. If
the ADD CODE * FROM OLDFILE command occurred first, Binder would place the
referenced RTDUs on the unresolved reference list with pointers to OLDFILE.
@ADD * FROM oldfile
@REPLACE * FROM sqlfile
@BUILD newfile!