Creating and Using an Enhanced Numeric Informat - SAS Programming

Here is an elegant way of reading a mixture of numeric and character data using what is called an enhanced numeric informat. This type of format became available in Release 6.07 of the SAS System. With this type of informat, you have the ability to specify numeric or character ranges.Here is the temperature example from ,using this type of informat:

Example

PROC FORMAT;
INVALUE TEMPER 70-11Q=JSAME_
'N' =98,6
OTHER=.;
RUN;
DATA TEST;
INPUT TEMP : TEMPER. @@;
DATALINES;
99.7 N 97.9 N N 112.5
;
PROC PRINT DATA=TEST NOOBS;
TITLE 'Temperature Listing';
RUN;

Output from Example - Creating and Using an Enhanced Numeric Informat

Output from Example - Creating and Using an Enhanced Numeric Informat

As you can see from the listing,the N's were converted to 98.6 and the out-of-range value was set to missing.


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

SAS Programming Topics