************************************* Name : pgm21 Purpose: In class example on day 2 to demonstrate : 1) Creating a new variable : 2) Using OPTIONS : 3) Printing selected variables : 4) Using comments History: Created by Sumi on 21May12. ***************************************; /* day 1 ex. revisited */ /* */ OPTIONS nonotes nodate; * Can use any where; data a; * gotta have at least one comment! ; * ; input firstnm $ 1-5 acctnm $ gender $ 20 q1 $ q2 $ num1 hgtft 33 hgtin 35-39 bday $ @40 birthday mmddyy8.; * read birthday twice -- once as ; * characters, second as date ; /* do some calculations */ * define a new variable; height = 12*hgtft + hgtin; cards ; Marie kmvick f c . 70 5 06 04/02/57 Kevin kswilli m a e 85 5 10 09/04/70 Betsy esfutrel f a b 75 5 05 08/29/64 Dean wdvogt m a b 30 5 07 04/22/73 Jimmy jdrhodes m a b 92 5 10 02/07/73 Ryan rmthomps m a d 80 6 00 11/14/71 Chris cdthomps m a c 68 5 08 01/28/72 ; * end of data step ; proc print data=a ; var firstnm height bday ; * just these variables ; title1 'first example, day 2' ; title2 'print just 3 vars'; run ; OPTION firstobs=2; * specify the first obs to process; proc print data = a (obs=5 /* specify the last obs to process */); run; * now print the previous statement w/o obs= ;