SAS Institute. The Power to Know

SAS(R) 9.2 Language Reference: Dictionary

space
Previous Page | Next Page

Formats

$CHARw. Format



Writes standard character data.
Category: Character
Alignment: left

Syntax
Syntax Description
Comparisons
Examples

Syntax

$CHARw.

Syntax Description

w

specifies the width of the output field.

Default: 8 if the length of variable is undefined; otherwise, the length of the variable
Range: 1-32767

Comparisons

  • The $CHARw. format is identical to the $w. format.

  • The $CHARw. and $w. formats do not trim leading blanks. To trim leading blanks, use the LEFT function to left align character data, or use the PUT statement with the colon (:) format modifier and the format of your choice to produce list output.

  • Use the following table to compare the SAS format $CHAR8. with notation in other programming languages:

    Language Notation
    SAS $CHAR8.
    C char [8]
    COBOL PIC x(8)
    FORTRAN A8
    PL/I A(8)


Examples

put @7 name $char4.;

Value of name Results

----+----1
XYZ
      XYZ

space
Previous Page | Next Page | Top of Page