DUPLICATE directive
Forms new data structures with attributes taken from an existing structure.
Options
Parameters
Description
The DUPLICATE directive allows you to define new data structures with attributes like those of existing structures. The attributes to be duplicated are defined by the ATTRIBUTES option. The structures from which the attributes are to be taken are specified by the OLDSTRUCTURES parameter, while the structures that are to be defined are specified by the NEWSTRUCTURES parameter. The other parameters allow some of the more important attributes to be reset at the same time. For example, here the factor Species2 takes its levels (and thus its number of levels) from the factor Species1. However, the labels are not transferred, and other values are defined using the VALUES parameter.
FACTOR [LEVELS=!(0,1); LABELS=!T(absent,present); \
VALUES=0,1,1,0,0,0,1] Species1
DUPLICATE [ATTRIBUTES=levels] Species1; \
NEWSTRUCTURE=Species2; VALUES=!(1,0,1,1,0,1,0)
You can set option REDEFINE=yes, to allow DUPLICATE to change the type of any new pre-defined new structure, if necessary, to have the same type as the corresponding old structure. Otherwise, DUPLICATE will report a fault if the new structure has previously been defined to have a different type.
Options: ATTRIBUTES, REDEFINE.
Parameters: OLDSTRUCTURE, NEWSTRUCTURE, VALUES, DECIMALS, CHARACTERS, EXTRA, MINIMUM, MAXIMUM.