COMPUTED VAR

Adds a variable that is not in the input data set to the report.

Details

Path

Select a column. Then select Editthen selectAdd Itemthen selectComputed Column.
After you select Computed Column, PROC REPORT prompts you for the location of the computed column relative to the column that you have selected. After you select a location, the COMPUTED VAR window appears.

Description

Enter the name of the variable at the prompt. If it is a character variable, then select the Character data check box and, if you want, enter a value in the Length field. The length can be any integer between 1 and 200. If you leave the field blank, then PROC REPORT assigns a length of 8 to the variable.
After you enter the name of the variable, select Edit Program to open the COMPUTE window. Use programming statements in the COMPUTE window to define the computed variable. After closing the COMPUTE and COMPUTED VAR windows, open the DEFINITION window to describe how to display the computed variable.
Note: The position of a computed variable is important. PROC REPORT assigns values to the columns in a row of a report from left to right. Consequently, you cannot base the calculation of a computed variable on any variable that appears to its right in the report.