Creating New Column Titles: AS

How to:

Reference:

Use the AS option to rename existing column titles in your reports. Any of the following titles can be changed with an AS phrase:

Syntax: How to Create Column Titles

The syntax for changing default titles is:

field AS 'title1,title2,...'

where:

field

Can be a sort field, display field, column total, or row total.

title

Is the new column title enclosed in single quotation marks.

To specify multiple lines in a column title, separate each line's text with commas. Up to five lines are allowed.

Reference: Usage Notes for New Column Titles

  • When using FOLD-LINE, the titles appear one over the other. No more than one line per title is allowed with FOLD-LINE. (See Reducing a Report's Width: FOLD-LINE and OVER.)
  • The use of a title line larger than the format size of the data is one convenient way to space out a report across the columns of the page. For instance,
    PRINT UNITS BY MONTH AS ' MONTH'

    shifts the title for MONTH to the right and all other columns, in this case UNITS, shift to the right. For more information on changing the column position, see Reducing a Report's Width: FOLD-LINE and OVER.

  • If you do not want any field name or title displayed in the report, you can also use the AS phrase by entering two consecutive single quotation marks. For example:
    PRINT LAST_NAME AS ''

    To display underscores, enclose blanks in single quotation marks.

  • If you put an AS phrase in a computed field, you must then repeat the keyword COMPUTE before the next computed field.
  • The width allotted for column titles has no limit other than the memory available. It is initially set to 6K, but if that is not enough, the space is dynamically extended to accommodate the column title space required.

Example: Creating New Column Titles

The following example assigns new column titles for the LAST_NAME, FIRST_NAME, and EMP_ID fields:

TABLE FILE EMPLOYEE
PRINT FIRST_NAME AS 'NAME' AND LAST_NAME AS ''
BY DEPARTMENT
BY EMP_ID AS 'EMPLOYEE,NUMBER'
END

This request produces the following report:

            EMPLOYEE                        
DEPARTMENT  NUMBER     NAME                 
----------  --------   ----                 
MIS         112847612  MARY        SMITH    
            117593129  DIANE       JONES    
            219984371  JOHN        MCCOY    
            326179357  ROSEMARIE   BLACKWOOD
            543729165  MARY        GREENSPAN
            818692173  BARBARA     CROSS    
PRODUCTION  071382660  ALFRED      STEVENS  
            119265415  RICHARD     SMITH    
            119329144  JOHN        BANNING  
            123764317  JOAN        IRVING   
            126724188  ANTHONY     ROMANS   
            451123478  ROGER       MCKNIGHT 

Information Builders