Labels are used to replace variable names in sas

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: DESIREE FirstName JobCode 0040 0071 WILLIAMS PERRY Salary PILOT 50221.62 ARLENE M. FLTAT ROBERT A. FLTAT 23666.12 21957.71 PROC Step proc print data=st.empdata split=' '; label LastName='Last Name' FirstName='First Name' Salary='Annual Salary'; title1 'Salary Report'; run; Obs Last Name First Name 1 2 3 0031 0040 0071 GOLDENBERG WILLIAMS PERRY Job Code Annual Salary DESIREE ARLENE M. ROBERT A. PILOT FLTAT FLTAT 50221.62 23666.12 21957.71 OPTIONS option . . . ; •The OPTIONS statement is not usually included in a PROC or DATA step. Salary Report Emp ID •You can use SAS system options to change the appearance of a report. •General form of the OPTIONS statement: 53 Using SAS System Options 54 Using SAS System Options Selected SAS system options: Selected SAS system options: DATE (default) prints the date and time the SAS session began at the top of each page of the SAS output. NUMBER (default) specifies that page numbers be printed on the first line of each page of output. NODATE does not to print the date and time the SAS session began. NONUMBER specifies that page numbers not be printed. PAGENO=n specifies a beginning page number (n) for the next page of SAS output. LINESIZE=width specifies the line size for the SAS log LS=width and SAS output. PAGESIZE=n PS=n specifies the number of lines (n) that can be printed per page of SAS output. 55 Example: options nodate nonumber ls=72; 56 14 Using SAS Formats Using User-defined Formats Enhance the readability of reports by formatting the data values. Create custom formats to recode data values in a report. Salary Report in Categories Salary Report Obs Emp ID Last Name 1 2 3 4 5 6 7 8 0031 0040 0071 0082 0091 0106 0355 0366 GOLDENBERG WILLIAMS PERRY MCGWIERMCGWIER-WATTS SCOTT THACKER BELL GLENN First Name Job Code DESIREE ARLENE M. ROBERT A. CHRISTINA HARVEY F. DAVID S. THOMAS B. MARTHA S. PILOT FLTAT FLTAT PILOT FLTAT FLTAT PILOT PILOT Emp ID 0031 0040 0071 0082 0091 0106 0355 0366 Annual Salary $50,221.62 $23,666.12 $21,957.71 $96,387.39 $32,278.40 $24,161.14 $59,803.16 $120,202.38 Last Name GOLDENBERG WILLIAMS PERRY MCGWIERMCGWIER-WATTS SCOTT THACKER BELL GLENN First Name JobCode DESIREE ARLENE M. ROBERT A. CHRISTINA HARVEY F. DAVID S. THOMAS B. MARTHA S. Pilot Flight Flight Pilot Flight Flight Pilot Pilot Annual Salary More than Attendant Less than Attendant Less than More than Attendant 25,000 to Attendant Less than More than More than 50,000 25,000 25,000 50,000 50,000 25,000 50,000 50,000 57 Formatting Data Values Formatting Data Values You can enhance reports by using SAS formats to format data values. SAS Data Set Format 58 • To apply a format to a specific SAS variable, use the FORMAT statement. • General form of the FORMAT statement: FORMAT variable(s) format; Report • Example: proc print data=st.empdata; format Salary dollar11.2; run; Values in the SAS data set are not changed. 59 60 15 What Is a SAS Format? SAS Formats • A format is an instruction that SAS uses to write data values....
View Full Document

This note was uploaded on 09/25/2013 for the course STAT 440 taught by Professor Muyot,m during the Fall '08 term at University of Illinois, Urbana Champaign.

Ask a homework question - tutors are online