The GIS Procedure

COMPOSITE Statement

Defines, modifies, or deletes associations between variables in the chains and nodes data sets.

Syntax

COMPOSITE operation composite-name </ options>;

Summary of Optional Arguments

indicates that the composite is a left/right type for spatial data variables that apply to the left and right sides of chains.
defines the role of the composite in the spatial database.
defines a variable or an association between related variables in the current spatial chains or nodes data set.

Required Argument

composite-name
specifies the composite that you want to create, replace, delete, or update. The composite-name value must conform to the following rules for SAS names:
  • The name can be no more than 32 characters long.
  • The first character must be a letter or underscore (_). Subsequent characters can be letters, numeric digits, or underscores. Blanks are not permitted.
  • Mixed-case names are honored for presentation purposes. However, because any comparison of names is not case-sensitive, you cannot have two names that differ only in case (for example, State and STATE are read as the same name).

Operations

You must specify one of the following values for the operation keyword:

CREATE
defines associations between variables in the chains and nodes data sets and stores these composites in the current spatial entry. The COMPOSITE CREATE statement does not overwrite existing composites. A warning is issued and processing of the current RUN group is halted if a composite with the specified name already exists. Use COMPOSITE REPLACE to overwrite an existing composite.
Note:Not all spatial database variables are composites of multiple SAS data set variables. Some composites represent a single SAS data set variable.
DELETE
deletes the specified composite from the current spatial entry. For the DELETE operation, you can also specify the following alternative forms for the composite-name argument:
  • a list of composite names, separated by spaces, to delete more than one composite in a single DELETE operation
  • the special value _ALL_ to delete all the composites in the current spatial entry
A warning is issued and processing of the current RUN group is halted if the specified composite does not exist.
Restriction:No additional arguments (other than the composite name) are used with the DELETE operation.
Note:The DELETE operation of the COMPOSITE statement removes a composite from the spatial entry but does not delete the SAS variables from their respective SAS data sets.
CAUTION:
Use DELETE with care.
The GIS procedure does not prompt you to verify the request before deleting an existing composite. Be especially careful when you use _ALL_.
REPLACE
overwrites the previous definition of a composite in the current spatial entry, or creates a new composite if the specified composite-name value did not previously exist.
UPDATE
applies new values for the specified arguments to an existing composite. A warning is issued and processing of the current RUN group is halted if there is no existing composite with the specified name.

Options

When you specify CREATE, REPLACE, or UPDATE for the operation argument in a COMPOSITE statement, you can specify one or more of the following additional optional arguments. Separate the list of options from the composite-name value with a slash (/).

BILATERAL
indicates that the composite is a left/right type for spatial data variables that apply to the left and right sides of chains. BILATERAL composites are used to define polygonal layers in a LAYER statement by denoting chains that have different left and right values. This argument provides an implicit VAR= argument, where the LEFT= and RIGHT= variable names are constructed by appending L and R to the specified composite name. For example, the following two statements are equivalent:
composite create state / class=area bilateral;

composite create state / class=area
                         var=(left=statel,right=stater);
CLASS=class-type
defines the role of the composite in the spatial database. The CLASS= option links specific functionality to particular composites
The class-type value for the CLASS= option can be one of the following:
ADDRESS
indicates that the composite defines addresses in the chains data set that is used for geocoding.
Data set address values are the numeric portion of a street address, for example, the 100 in the street address, 100 North Main Street. A chain has four values to define the address range for each side:
FROMLEFT
beginning address on the left side.
TOLEFT
ending address on the left side.
FROMRIGHT
beginning address on the right side.
TORIGHT
ending address on the right side.
When you use specify ADDRESS for the class-type value, you must use the following form of the VAR= argument:
VAR=(<FROMLEFT=>variable, <FROMRIGHT=>variable,
<TOLEFT=>variable, <TORIGHT=>variable)
AREA
indicates that the composite defines polygonal areas.
For polygonal areas that represent political subdivisions, you can specify the following alternative class-type values to indicate which features the areas represent:
COUNTRY
indicates that the composite defines countries in the chains data.
COUNTY
indicates that the composite defines counties in the chains data.
STATE
indicates that the composite defines states in the chains data. Composites of this class are used in geocoding.
When you use AREA (or COUNTRY, STATE, or COUNTY) for the class-type value, you must specify the bilateral form of the VAR= argument to specify the variables that identify the features on the left and right sides of each chain in the area:
VAR=(<LEFT=>variable, <RIGHT=>variable)
CITY | PLACE
indicates that the composite defines features that are related to geographic location, such as cities. Composites of this class are used in geocoding.
By default, CITY is not considered an AREA-type composite. If your spatial data contain closed city boundaries, you must explicitly define the composite as an AREA class as well:
composite create towns / var=(cityl cityr) class=(city area);
CLASSIFICATION
indicates that the composite defines a general descriptive value that can be used to classify features in the map.
Note:In order to create new point layers when you add points to the map interactively in the GIS Map window, you must define at least one CLASSIFICATION-type composite in the spatial entry.
DIRECTION_PREFIX
indicates that the composite defines the directional prefix component of an aggregate feature name, such as the North in North Main Ave. Composites of this class are used in geocoding.
DIRECTION_SUFFIX
indicates that the composite defines the direction suffix component of an aggregate feature name, such as the South in 2nd St South. Composites of this class are used in geocoding.
NAME
indicates that the composite defines the names of features in the chains data, such as Central Park, or the name component of an aggregate feature name, such as the Main in E Main St. Composites of this class are used in geocoding.
PLUS4
indicates that the composite defines extended postal delivery codes (U.S. ZIP+4) in the chains data. Composites of this class are used in address matching.
By default, PLUS4 is not considered an AREA-type composite. If your chains data contain closed ZIP+4 boundaries, you must explicitly define the composite as an AREA class as well:
composite create zip4 / var=(zip4l zip4r) class=(area plus4);
TYPE
indicates that the composite defines the feature type component of an aggregate feature name, such as the Ave in N Harrison Ave. Composites of this class are used in geocoding.
X
indicates that the composite defines the X coordinates for the nodes in the nodes data set.
Y
indicates that the composite defines the Y coordinates for the nodes in the nodes data set.
ZIPCODE
indicates that the composite defines postal delivery codes in the chains data. Composites of this class are used in geocoding.
By default, ZIPCODE is not considered an AREA-type composite. If your chains data set contains closed ZIP code area boundaries, you must explicitly define the composite as an AREA class as well:
composite create zip / var=(zipl zipr)
                       class=(zipcode area);
Default:CLASSIFICATION
VAR=association-declaration
defines a variable or an association between related variables in the current spatial chains or nodes data set. Variables for all composites are assumed to be in the chains data set except for CLASS=X and CLASS=Y variables, which must be in the nodes data set.
The VAR= argument is required when you use the CREATE or REPLACE operations, except in the following circumstances:
  • If you omit the VAR= argument and specify CLASS=CLASSIFICATION (or omit the CLASS= argument), the composite-name value that you specify is also used as the variable name. For example, the following statements are equivalent:
    composite create cfcc;
    
    composite create cfcc / var=cfcc class=classification;
  • If you omit the VAR= argument and specify one of the bilateral class-type values such as AREA or STATE, the suffixes L and R are added to the composite-name value to form the variable name pair for the association. For example, the following statements are equivalent:
    composite create state / class=state;
    
    composite create state / class=state
                             var=(statel stater);
    For other class-type values, the VAR= argument is required when you use the CREATE or REPLACE keywords.
The association-declaration argument for the VAR= option can be one of the following, depending on the class-type values that are specified in the CLASS= option:
variable
declares a composite consisting of a single SAS variable. Use this form for single-variable association classes such as CLASSIFICATION, DIRECTION_PREFIX, DIRECTION_SUFFIX, NAME, TYPE, X, and Y.
(<LEFT=>variable-1, <RIGHT=>variable-2)
declares a composite consisting of two variables that represent the left and right sides of a feature. Association declarations of this form can be used to define the boundaries between elements in the spatial data. Use this form for bilateral association classes such as AREA, CITY, COUNTRY, COUNTY, PLACE, STATE, ZIPCODE, and PLUS4.
(<FROMLEFT=>variable-1, <FROMRIGHT=>variable-2, <TOLEFT=>variable-3, <TORIGHT=>variable-4)
declares a composite that consists of four variables that separately represent the beginning and end of the left and right sides of a feature. Association declarations of this form can be used to define the locations of specific addresses in the spatial data. Use this form for the ADDRESS class.
Note: Variable is the name of a SAS data set variable in the chains data set. An error occurs if any of the specified variables do not exist in the chains data set.

Details

Once defined, composites can be referenced by other GIS procedure statements. For example, if a spatial database contains the variables COUNTYL and COUNTYR that identify the chains' left and right values for a county ID variable, you could use the COMPOSITE statement to create a composite called COUNTY by associating the two spatial database variables. The COUNTY composite could then be used to define the county boundaries for the map.
Composites are stored in the currently specified spatial (GISSPA) entry. An error occurs if you submit a COMPOSITE statement when no spatial entry is currently selected.
Note: Use the SPATIAL CONTENTS statement to view the composites for a spatial entry. Composite variable values are also displayed in the Spatial Information window when you select a map feature in the GIS Map window.

Examples

Example 1: Define a Single-Variable Composite

The following code fragment associates the class Y with the variable named LAT in the nodes data set to indicate that the variable contains north-south coordinate information:
composite create latitude / var=LAT
                            class=y;
run;

Example 2: Define a Composite for a Bilateral Feature

Both of the following code fragments associates a pair of variables in the chains data set that contain values for the left and right sides of area boundaries:
composite create state / var=(left=statel,right=stater)
                         class=area;
run;
composite create state/ bilateral
                        class=area;
run;

Example 3: Define a Composite for an Address Feature

The following code fragment associates two pairs of variables in the chains data set that contain values for the corners of address boundaries:
composite create custadd /
   var=(fromleft=FRADDL,fromright=FRADDR,
        toleft=TOADDL,toright=TOADDR)
   class=address;
run;