*Program 5-6 Creating a permanent format library; libname myfmts 'c:\temp\formats'; proc format library=myfmts; value $gender 'M' = 'Male' 'F' = 'Female' ' ' = 'Not entered' other = 'Miscoded'; value age low-29 = 'Less than 30' 30-50 = '30 to 50' 51-high = '51+'; value $likert '1' = 'Strongly disagree' '2' = 'Disagree' '3' = 'No opinion' '4' = 'Agree' '5' = 'Strongly agree'; run; *Program 5-7 Adding label and format statements in the DATA step; libname learn 'c:\temp'; options fmtsearch=(myfmts); data learn.survey; infile 'c:\temp\survey.txt' pad; input ID : $3. Gender : $1. Age Salary (Ques1-Ques5)(: $1.); format Gender $gender. Age age. Ques1-Ques5 $likert. Salary dollar10.0; label ID = 'Subject ID' Gender = 'Gender' Age = 'Age as of 1/1/2006' Salary = 'Yearly Salary' Ques1 = 'The governor doing a good job?' Ques2 = 'The property tax should be lowered' Ques3 = 'Guns should be banned' Ques4 = 'Expand the Green Acre program' Ques5 = 'The school needs to be expanded'; run; *Program 5-8 Running PROC CONTENTS on a data set with labels and formats; title "Data set SURVEY"; proc contents data=learn.survey varnum; run;