Append

PURPOSE:  The APPEND command adds a copy of the records of one or more DS to the end of another DS.  The currently declared DS can be either the source or the destination of the data to be copied.

SYNTAX

APPEND {TO ds_name; FROM \ds_name\}

TO ds_name

specifies the destination of copied records of the current  DS in USE is to be added to another DS.

FROM ds_name

specifies one DS or a list of DS(s) whose records are to be added to the current  DS in USE.  There is no limit on the number of source DS’s that can be specified.

EXAMPLE

*USE DS ROYALTIES

*APPEND FROM TEMP_DAT, TEMP_DAT2, TEMP_DAT3

*USE DS TEMP_DAT

*APPEND TO ROYALTIES

NOTES:  The DS’s must all have the same SD and must all exist in the current DBL.  The IN DBL clause is not allowed in this command.

The APPEND command allows no conditional clauses.  The appending capability of other Data Manipulation commands can be used for conditional appending.

The APPEND command is very efficient, because it does not copy the records one by one, but appends them in large blocks.