SAS OnlineTutorback||next

Try It! Using the Perm.Powrcost data set, permanently associate formats with variables.

Creating HTML output? Read this first.

  1. Copy the program below and paste it into the Program Editor window (or issue the command copy sashelp.oltutor. .source). A LIBNAME statement and a FILENAME statement have already been submitted for you.
    data perm.powrcost;
       infile powerdat;
       input FirstDay date7. 
             @10 LastDay date7.
             @19 KwhUsed 4. 
             @25 KwhRate 5.;
       Days=lastday-firstday+1;
       AverageCost=(kwhused*kwhrate)/days;
    proc print data=perm.powrcost;
    run;
  2. Add a FORMAT statement to the DATA step that formats the following:
         LastDay       DATE9.
         FirstDay      DATE9.
         AverageCost   DOLLAR5.2
  3. Submit the program and view the PROC PRINT output.

    Return here and select Next.

Solution
back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA.
All rights reserved.

Terms of Use & Legal Information | Privacy Statement