SET Type

12-1
The SET type allows the definition of a fixed number of components where order is irrelevant. Within the set each component must be given a name, unless its base type is CHOICE. When a set is transferred from one system to another the items in the SET can be sent in any order. Items in the set can be optional, as indicated by the OPTIONAL keyword, for example:
Contact ::= SET {    name                 [1]   GraphicString,    title                [2]   GeneralString,    businessNumber       [3]   NumericString,    afterHoursNumber     [4]   NumericString OPTIONAL}
When referring to SET items in NCL they are referenced by name, and hence the order that the data is stored in within the set is unimportant, and is in fact arbitrary.
An item in a SET can be a CHOICE of a number of alternatives. Such an item need not be explicitly named, but in this case each alternative of the choice must be named, and each must be unique amongst all other items within the entire SET. Alternatively, the SET item that is a CHOICE might indeed be named, and in this case only that name must be unique, as the CHOICE components are pushed to the next level in the component name hierarchy. For example, the following is valid:
Contact ::= SET {    name                 [4]   GraphicString,    title                [5]   GeneralString,    businessNumber       [6]   NumericString,    CHOICE {            pagerNumber  [1] NumericString,            homeNumber   [2] NumericString           } ,    additionalContact    [9] CHOICE {                                     pagerNumber  [1] NumericString,                                     homeNumber   [2] NumericString                                    }                 }
This results in allowing the following component names to be referenced from NCL:
  • Name
  • Title
  • BusinessNumber
  • PagerNumber
  • HomeNumber
  • AdditionalContact.pagerNumber
  • AdditionalContact.homeNumber
All SET items must be differentiated by an ASN.1 tag value. It is good practice to explicitly tag all SET items rather than default to tags of the ASN.1 base types.

External Form -- Input and Output

All structures have an external form that is the same as their local form.

Local Form and Behavior

The local form of a SET is the data stream consisting of each set component, where each component has its leading tag and length (as determined by the parent component) and data in the local form for its type.

Named Values

Named values are not applicable to the SET type.

Constraints

Constraints are not applicable to the SET type.