SAS INFORMATS vs. FORMATS & PROC FORMAT Custom Mappings
Understand how SAS reads raw data into internal values and renders visual representations.
An INFORMAT instructs SAS how to read raw input data into internal numeric or character variables (Input). A FORMAT instructs SAS how to display stored values on screen and reports (Output). PROC FORMAT creates custom user-defined formats to categorize continuous variables or decode numeric codes into human-readable labels.
Why Ingestion INFORMATS & Formats Matter for Data Hygiene #
Essential for handling dates, timestamps, currency symbols, and clinical trial visit codes without altering the underlying raw data precision.
Standard Syntax, Derivation & Framework Pattern #
/* Creating Custom Formats and Applying Formats */
PROC FORMAT;
VALUE $gender_fmt
'M' = 'Male'
'F' = 'Female'
OTHER = 'Unknown';
VALUE age_grp
LOW - 12 = 'Child'
13 - 15 = 'Young Teen'
16 - HIGH = 'Older Teen';
RUN;
DATA work.formatted_class;
SET sashelp.class;
FORMAT Sex $gender_fmt. Age age_grp.;
RUN;
Core Rules #
- INFORMAT = Ingesting/Reading data. FORMAT = Presenting/Displaying data.
- All format and informat names must end with a period (.) in SAS statements.
- Character formats must always start with a dollar sign ($).
- Applying a FORMAT changes only how the data looks in output and procedures; the underlying stored value remains untouched.
Frequently Asked Questions (FAQ) #
What is the key difference between an INFORMAT and a FORMAT in SAS?
An INFORMAT converts raw external data into internal SAS binary storage. A FORMAT takes internal SAS values and displays them as formatted text strings on reports.
Why must format names end with a period?
The trailing period (.) signals to the SAS compiler that the token is a format specification rather than a standard variable name.
Want complete video breakdowns, code files & exercises?
Explore comprehensive step-by-step masterclass training in our authoritative SAS Certification Course & Programming Training.