TEMPORARY

<< Click to Display Table of Contents >>

Navigation:  Reference > Commands >

TEMPORARY

The form of the TEMPORARY command is:

TEMPORARY/n/,

The TEMPORARY command is non-executable and may only appear once, after START DATA and before the first executable command. It is used to inform CL that more (or less) than the standard allocation of space is required for temporary variables. The n specifies the amount of space required in words (see below).

Variables defined at the Data Stage are automatically written to the Intermediate Data File (IDF) for use at later stages, unless they are defined as temporary variables. A temporary variable has a name beginning with the letter X.

Any type of variable can be a temporary variable.

It is useful to define a variable as temporary if it is known in advance that it will not be required at a later stage, because this means that the records in the IDF will be shorter, and Tables Stages that process the IDF will be correspondingly quicker to run.

Temporary variables occupy a particular space in memory at execution time, and the standard allocation of space for this purpose is 10000 words. A word as used here is 2 bytes or 16 bits.

If more than 10000 words of temporary variable space are required, the TEMPORARY command should be used. To calculate how much space is needed, the following rule-of-thumb can be employed:

wvars 4 words each

ivars 2 words each

svars 1 word each

cvars 1 word for every two characters

mvars 1 word for each 16 bits

If there is room sequentially defined svars and mvars will be placed is the same word.

If the amount of space required for temporary variables exceeds that allocated, a compilation error occurs.

The whole of the temporary area can be preserved between FINISH and START DATA, see the PRESERVE command.

Examples of TEMPORARY commands:

temporary/250/,

temporary/5000/,