Than 50000 25000 25000 50000 50000 25000 50000 50000

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: SAS formats have the following form: <$>format<w>.<d> Indicates a character format Total width (including decimal places and special characters) w.d 8.2 $w. $5. standard numeric format Width=8, 2 decimal places: standard character format Width=5: KATHY COMMAw.d COMMA9.2 commas in a number Width=9, 2 decimal places: 12,234.21 DOLLARw.d DOLLAR10. Number of decimal places Required delimiter Format name Selected SAS formats: dollar signs and commas in a number Width=10, 2 decimal places: $12,234.21 12234.21 61 Formatting Data Values SAS Formats EmpID Format COMMA12.2 12.2 DOLLAR12.2 DOLLAR9.2 DOLLAR8.2 DOLLAR5.2 DOLLAR4.2 GOLDENBERG DESIREE 0040 0071 Displayed Value 27,134.29 27134.29 $27,134.29 $27134.29 27134.29 27134 27E3 LastName 0031 If you do not specify a format width large enough to accommodate a numeric value, the displayed value is automatically adjusted to fit into the width. Stored Value 27134.2864 27134.2864 27134.2864 27134.2864 27134.2864 27134.2864 27134.2864 62 FirstName JobCode WILLIAMS PERRY Salary PILOT 50221.62 ARLENE M. FLTAT ROBERT A. FLTAT st.empdata 23666.12 21957.71 PROC Step proc print data=st.empdata split=' '; label LastName='Last Name' FirstName='First Name' Salary='Annual Salary'; format Salary dollar11.2; title1 'Salary Report'; run; Salary Report Obs 63 Emp ID Last Name 1 2 3 0031 0040 0071 GOLDENBERG WILLIAMS PERRY First Name Job Code DESIREE ARLENE M. ROBERT A. PILOT FLTAT FLTAT Annual Salary $50,221.62 $23,666.12 $21,957.71 64 16 SAS Formats Examples: Recall that a SAS date is stored as the number of days between 01JAN1960 and the specified date. DATEw. Displayed Format Value DATE7. 16OCT01 DATE9. 16OCT2001 Format 0 MMDDYY8. MMDDYY10. 1 Selected SAS date formats: Stored Value 0 SAS date formats display SAS date values in standard date forms. MMDDYYw. Displayed Format Value MMDDYY6. 101601 MMDDYY8. 10/16/01 MMDDYY10. 10/16/2001 SAS Formats DATE9. Displayed Value 01/01/60 01/01/1960 02JAN1960 -1 365 DDMMYY10. 31/12/1960 366 65 WORDDATE. December 31, 1959 WEEKDATE. Sunday, January 1, 1961 66 Lab Exercises 5 Producing List Reports 67 17...
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