CSSM Procedure

ID Statement

  • ID variable <option> ;

The ID statement names a numeric variable to associate a sequence value—usually related to a timestamp—with the observations in the input data set. The ID statement is required. Internally, the CSSM procedure sorts the observations in ascending order by the ID variable within a BY group. If you also supply an OBSINDEX variable, the observations are sorted by both the ID variable and the OBSINDEX variable. Often the ID variable’s values are SAS date, time, or datetime values, and each observation within a BY group has a unique ID value. Generally, however, the ID variable can be any numeric variable, and there can be multiple observations with the same ID value. If the ID values are SAS date, time, or datetime values, you can specify the associated unit of time—for example, day, week or month—by using the INTERVAL= option. A variable, _ID_DELTA_, is automatically created that can be used as any input data set variable in the programming statements. _ID_DELTA_ contains the distance between two successive ID values. The first _ID_DELTA_ value is arbitrarily taken as 1. If the INTERVAL= option is specified, the distance between the ID values is measured in terms of the number of intervals; therefore, for regularly spaced data, _ID_DELTA_ is identically equal to 1. You can specify the following option in the ID statement:

INTERVAL=value

specifies the unit of time interval that is used to measure the ID values. INTERVAL=value is used in conjunction with the ID variable to verify that the input data are in the proper order. For a complete discussion of the supported intervals, see Chapter 4, Date Intervals, Formats, and Functions (SAS/ETS User's Guide).

Last updated: July 09, 2026