![]() Chapter Contents |
![]() Previous |
![]() Next |
| INFORMAT |
| Valid: | in a DATA step or PROC step |
| Category: | Information |
| Type: | Declarative |
Syntax |
|
INFORMAT variable(s)
<informat>
<DEFAULT=default-informat>; |
A DEFAULT= informat specification applies to
| Details |
![[cautend]](../common/images/cautend.gif)
| Comparisons |
| Examples |
This example uses an INFORMAT statement to associate a default numeric informat and a default character informat:
data tstinfmt; informat default=3.1 default=$char4.; input x1-x10 name $; put x1-x10 name; datalines; 1 22 33 44 55 66 77 88 99 100Johnny ;The PUT statement produces this result :
----+----1----+----2----+----3----+----4----+ .1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 9.9 10 John
This example associates a character informat and a numeric informat with SAS variables. Although the character variables do not fully occupy 15 column positions, the INPUT statement reads the data records correctly by using modified list input:
data name; informat FirstName LastName $15. n1 6.2 n2 7.3; input firstname lastname n1 n2; datalines; Alexander Robinson 35 11 ; proc contents data=name; run; proc print data=name; run;
The SAS System 3
CONTENTS PROCEDURE
-----Alphabetic List of Variables and Attributes-----
# Variable Type Len Pos Informat
------------------------------------------------
1 FirstName Char 15 16 $15.
2 LastName Char 15 31 $15.
3 n1 Num 8 0 6.2
4 n2 Num 8 8 7.3 |
The SAS System 4
OBS FirstName LastName n1 n2
1 Alexander Robinson 0.35 0.011 |
data rtest; set rtest; informat x; run;
| See Also |
Statements:
|
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.