Previous Topic: DESCRIPT Statement

Next Topic: DISPLAY Statement


Variable Description Feature

You may find that at a particular sort level, there are a number of fields whose descriptions are almost the same except for a small amount of variable information. For example, at level 1 a report might sort through 20 or 25 Project IDs. In this case, rather than code a separate DESCRIPT statement for each control break or summary line, the user may prepare a single DESCRIPT statement and, by using the Variable Description feature, transfer the Project ID automatically from the sort control field into the description field. Refer to the SORT statement on :spotref refid=vsort..

You invoke this feature by replacing the first four characters of the Description Control Field with four asterisks. These indicate that the next four positions determine what is transferred from the Sort Control Field. The four asterisks are followed by:

2 characters indicating where the transferred data is placed in the Description field

1 character indicating how many characters of data to transfer

1 character indicating from which position in the Sort Control Field the transfer of the data is to begin.

The following example shows typical variable description usage:

     Summarization Level
     │
     │             Invokes
     │    Variable Description Feature
     │      │
     ▼      ▼
          ┌────┐      ┌────────────────┐
ADESCRIPT1│****│ 0981 │PROJECT XXXXXXXX│
          └────┘      └────────────────┘
                             ▲
                             │
               This will appear on every summary
               line at this sort control level.

This statement defines the format for Report A. The summarization level is 1, followed by the four asterisks that invoke the Variable Description feature. The variable information (Project ID, in this case) located in the positions 1-8 of the sort control field, is transferred to the positions 9-16 of the description field (overlaying the xs appearing in the example).

Note that DESCRIPT statements using the variable description feature and those that contain blank description control fields share one characteristic; they terminate the DESCRIPT statement searching logic, and are used regardless of the current contents of the sort control field. DESCRIPT statements with blank description control fields are intended to be used for catchall or miscellaneous descriptions and should follow all DESCRIPT statements with nonblank description control fields.