/* Printing Coded Data using PROC FORMAT */ data roll; *infile 'z:\My Documents\teaching\stat_517\sas_roll.txt'; FILENAME webpage URL 'http://people.stat.sc.edu/hitchcock/sas_roll.txt'; INFILE webpage; INPUT last :$10. first :$9. major grad $ class; run; PROC FORMAT; VALUE maj_code 135 = 'Statistics' 145 = 'Mathematics' 156 = 'Industrial Statistics'; VALUE $gr_code 'G' = 'Graduate Student' OTHER = 'Undergraduate Student'; VALUE cl_code 1 = 'Freshman' 2 = 'Sophomore' 3 = 'Junior' 4 = 'Senior' 5 = 'Graduate Student'; /* self-created format names must begin with $ for character data */ run; PROC PRINT data = roll; FORMAT major maj_code. grad $gr_code. class cl_code.; /* self-created format names end with a period in the FORMAT statement */ VAR first last major grad class; /* Note I've changed the order of the variables being printed */ title 'STAT 517 roll'; run;