Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Format vs Informat 1

Status
Not open for further replies.

Fuzemmo

Programmer
May 16, 2002
52
US
Does anyone have an easy to understand/explain definition of the difference between these two concepts?
 
Yup.
A format determines how a value is displayed.
An Informat determines how a value is read.
IE, if you are reading a text file which contains dates, you'll need to tell SAS what format these dates are in so it knows how to treat it, so you use the DDMMYY10 INformat. SAS then reads that in and converts it to a SAS date (count of days since 01/01/1960). When you want to display that, you can't just write that out as it'll just be a large number. In order to be human readable, you need to use the DDMMYY10. format. In this case the format and informat have the same name, which makes it easy to use, but a little confusing if you're trying to understand what the difference is.
Also, INFORMATs can be used with the INPUT() function, and FORMAT with the PUT() function.

Chris
Business Analyst, Code Monkey, Data Wrangler.
SAS Guru.
 
Thank-you Chris. That is what I "thought" it was, but its nice to get confirmation.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top