Chapter Contents

Previous

Next
$w.

$w.



Reads standard character data

Category: Character


Syntax
Syntax Description
Details
Comparisons
Examples

Syntax

$w.

Syntax Description

w
specifies the width of the input field. You must specify w because SAS does not supply a default value.
Range: 1-32767


Details

The $w. informat trims leading blanks and left aligns the values before storing the text. In addition, if a field contains only blanks and a single period, $w. converts the period to a blank because it interprets the period as a missing value. The $w. informat treats two or more periods in a field as character data.


Comparisons

The $w. informat is almost identical to the $CHARw. informat. However, $CHARw. does not trim leading blanks nor does it convert a single period in an input field to a blank, while $w. does both.


Examples

input @1 name $5.;

Data Lines Results*
----+----1

XYZ
XYZ##
 XYZ
XYZ##
  .

 X YZ
X#YZ#
*The character # represents a blank space.


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.