Formats and informats - using dates, labels and formats to make nice table and plots

Last changed: 16 August 2019

When we program in any language it is desirable to use short variable labels and short names in text variables, e.g. we would use treat or treatment as our variable instead of 'type of pressure treatment', which would be more informative. The treatments would be called A and B , or 1 and 2, instead of describing which kind of treatment it is. In tables and graphs we would however like to have more information. Then in SAS we can use formats and labels.



 Formats in data and proc steps:

If you use the format statement in a procedure like procedure print it is valid only in this step. If you print the data again later without the format statement you will see the date variable again as number and the variables again have their actual values.

If you use the format statement in a data step the format is permanent and will follow your dataset.