Aspen SCM‎ > ‎Expert System‎ > ‎1. Elements‎ > ‎

1.2 Entities and Data Types


Aspen SCM Expert System has two types of data structure:

  • sets;

  • tables;

and three types of variable:

  • rule variables, which may be either local to a rule (beginning with a ?, e.g. ?MYVAR) or global across all rules, (beginning with a :, e.g. :MYVAR);
  • amper variables, which being with an & or a $ and which are either general-purpose (&0 - &9, $1 - $9) or special-purpose, e.g. &CASENAME, &DATE; these can be used in Aspen SCM commands, macros and dialogs as well as in rules;
  • percent variables, which begin with a % (%0 - %9) and which are used for the values of arguments passed to macros and rules.

Data Types

There are three data types:

  • integer (32 bit);

  • floating point (32 bit);

  • character string.

Sets and Amper Variables

All sets and amper variables hold their data in character format. Sets in Aspen SCM Expert System take the form of a Code section and a Description section. Each of these is a maximum of 64 characters long, although most sets have Codes which are 8 characters long. If a set is assigned numeric values, e.g. MYSET = 20 this actually causes the elements of the set to take the left-justified character values 0, 1, 2, 3, … 19. If you sort the set the values 10, 11, … 19 lie between 1 and 2 because the sort is character-based. You can sort numerically by using the keyword NUM, e.g. SORT MYSET NUM.


Tables have their data type defined when they are created. They can be integer, floating point or character string (up to 64 characters). If the data type is changed (except for changes of character string length), all the data are erased. Tables are essentially two-dimensional, although there is the concept of the multi-dimensional table, which is implemented as a sparse table of character string data using the standard two-dimensional structure.

String and Panel Tables

As well as two-dimensional tables containing character strings, there are what are known as string and panel tables. These have been designed to make it possible to produce reports (string tables) and their interactive equivalents (panel tables). They are essentially columns of character strings of up to 256 characters in which you can address sub-strings directly. Aspen SCM Expert System’s character-manipulation facilities are elementary (there is no INDEX function to find a sub-string) and it is only with string and panel tables that you are able to write to sub-strings. The syntax for referencing string and panel tables is idiosyncratic, with three arguments: for the row; start position; and number of characters to be read or written.

Rule and Percent Variables

Rule and percent variables have data types which change according to their most recent use. There is no form of declaration statement to define their existence or specify their data type. Any misspelling creates a new variable. If the name of a variable exceeds 8 characters the extra characters are ignored, so ?MYVARIABLE and ?MYVARIABLE2 are identical and are actually ?MYVARIA.

When rule and percent variables hold character data there is a maximum length for the string of 79 characters. This includes leading and embedded blanks but excludes trailing blanks, which are always stripped from character variables. Any string operation (e.g. concatenation) that results in a string of more than 79 characters or a string with trailing blanks is truncated. The only exception is that string and panel tables can contain strings up to 256 characters long and can have trailing blanks. Commands such as FILL can be used to transfer strings of any length between such tables but otherwise it is impossible to manipulate substrings within them of more than 79 characters.

Back                                Next