SAS OnlineTutorback||next

Try It! Using the Clinic.Admit data set, add cell traffic-lighting.

Creating HTML output? Read this first.

  1. Copy the following program and paste it into the Program Editor window (or issue the command copy sashelp.oltutor..source).
ods listing close;
ods html path='?' body='?';
proc format;
   value $colsex 'F'='lipk'
                 'M'='vpab';
run;
proc tabulate data=clinic.admit format=4.1;
   var age / style=<parent>;
   class sex actlevel / style={background=vpag};
   classlev sex / style={background=$colsex.};
   classlev actlevel / style=<parent>;
   table sex*actlevel*age*{style={font_weight=bold
         foreground=black}},mean /
         box={style={background=vpag}};
   keyword mean / style={background=vpag};
run;
ods html close;
ods listing;
  1. Replace the question marks (?) with PATH= and BODY= values that conform to your system's file structure. Remember that you can use the URL= suboption in PATH=, BODY=, or both.

  2. Submit the program and examine its output in your browser.

  3. Recall the program in the SAS Program Editor, then create a user-defined format for cell traffic-lighting. Name the format AGEALERT and give it these values:

    • low-29='lio' (SAS/GRAPH color name light orange)

    • other='vpag' (SAS/GRAPH color name very pale green)

  4. Apply the format by adding it to the STYLE= option attached to the Age variable in the TABLE statement. Use AGEALERT as the value of the background attribute.

  5. Submit the program and examine its output in your browser.

    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