Literal definitions

<< Click to Display Table of Contents >>

Navigation:  Reference > Commands >

Literal definitions

A literal definition command takes the form:

DC cvar[(substring)] = literal,

D field = literal,

D col = literal,

The characters in the literal are stored in the variable.

If the data is CSV then the definition which picks up raw data will be $* which means the column with the header which is the same as the variable being defined.  The size of the character variable must be defined beforehand.

If the variable is a cvar, note that the length of the cvar is the number of characters in the literal. The maximum length for a cvar is 128 characters. Substrings may only be used on second or subsequent definitions.

If the variable is a field, the code equivalent of the characters in literal are placed in field. Note that the number of characters must be equal to the number of cols in field.

If the variable is a col, the contents are replaced by the codes corresponding to the character literal; thus if literal is 'B', col is set to codes V and 2. Note that in this case literal may only be a single character.

Examples of literal definition commands:

dc $name='Mr. Bloggs',

dc $name(1:4)='Mrs.',

d $503-510='OX10 0QU',

d $1206='A',

 

dc $address(200),

dc $address = $*,