Copy-APIs

Normally, working with the ITP/SDK for iSeries starts with the STRITP command. All SDK functions are performed inside of the context of the SDK. Exceptions to this rule are the ITP/SDK for iSeries APIs. These are commands that may be called outside of the context of the SDK, but perform functions that work with and possibly change the contents of the (data in the) SDK.

The supported APIs are:

COPYDID

Copy a DID from one iSeries library to another. Only the information of the DID and all DID-sources linked to it are copied. iSeries objects referenced in the DID are not copied.

COPYDIDINF

Copy a DID from one iSeries library to another. Only the information of the DID not including the information of DID-sources linked to it is copied.

COPYDIDSRC

Copy a DID-source from one iSeries library to another. Only the information of the DID-source is copied. iSeries objects referenced in the DID are not copied.

These APIs copy the information from one iSeries library to another (these libraries may not be the same) and operate directly on the physical files from the SDK database. The default values for the FROM parameters of these commands (FROMDIDLIB, FROMDIDFIL, FROMSRCLIB and FROMSRCFIL) are the names of the library and files for the standard SDK database. If any of the files to copy the information to does not exist, the COPY-API will create it.

The REPLACEDB-parameter of the command controls the action to take when one or more of the files to copy to already exist.

*NONE

The copy action will be cancelled. No copy will be performed.

*ADD

The information to be copied will be added to the information already present in the files to copy to.

*REPLACE

The information to be copied will replace the information already present in the files to copy to; the contents of the files that already exist will be cleared before the new information is written to it. Beware: it is not recommended to use this setting when the target database is the SDK database.

When *ADD is used in the REPLACEDB parameter of the Copy-API, an additional REPLACE-parameter on the command (REPLACEDID or REPLACESRC) controls what to do when the copy action would lead to duplicate information in the files to copy to (i.e. if the DID or DID-sources to copy are already present in these files).

*NONE

The copy action will be cancelled. No copy will be performed.

*REPLACE

The information to be copied will replace the information already present in the files to copy to; any information on the DID or DID-sources to copy that is already present in the files will be deleted before the new information is written to it. Any other information (not related to the DID or DID-sources to copy) is not affected by the copy operation. Beware: this also applies to DID-sources linked to a DID to copy.

The official interfaces for these Copy-APIs are the commands. However, the sources of the commands and their command processing (CL) programs are part of the SDK distribution as well in the source physical files QCMDSRC and QCLSRC in the SDK program library.