![]() Chapter Contents |
![]() Previous |
![]() Next |
| $VARYINGw. |
| Valid: | in a DATA step |
| Category: | Character |
| Syntax | |
| Syntax Description | |
| Details | |
| Examples | |
| Example 1: Obtaining a Current Record Length Directly | |
| Example 2: Obtaining a Record Length Indirectly | |
Syntax |
| $VARYINGw. length-variable |
| Default: | 8 if the length of the variable is undefined; otherwise, the length of the variable |
| Range: | 1-32767 |
| Details |
| Examples |
input fwidth 1. name $varying9. fwidth;
| Data Lines* | Results |
|---|---|
----+----1 |
|
5shark |
shark |
3sunfish |
sun |
8bluefish |
bluefish |
| *Notice the result of reading the second data line. | |
data one;
infile file-specification length=reclen;
input @;
fwidth=reclen-9;
input name $ 1-9
@10 class $varying20. fwidth;
run;
| Data Lines | Results |
|---|---|
----+----1----+----2 |
|
PATEL CHEMISTRY |
PATEL CHEMISTRY |
JOHNSON GEOLOGY |
JOHNSON GEOLOGY |
WILCOX ART |
WILCOX ART |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.