Sample Programs: DS2CSF Macro


The following sample programs generate diagrams using the DS2CSF macro:

  • Sample Diagrams Using DS2CSF on page 530

  • Adding a Link to a Critical Success Factor Diagram on page 532.

Sample Diagrams Using DS2CSF

A CSF (Critical Success Factor) diagram represents a value in a range of data. This value can be obtained from a SAS data set variable or an SCL variable. The range of data used by the CSF is depicted by segments, with each segment containing a beginning and ending value, and possibly a different color . The number of segments and their corresponding colors are defined in a RANGE entry that is associated with the CSF.

Results Shown in a Browser

The sample program displays two forms of CSF ”one an analog dial, and the other a digital display.

click to expand

SAS Code

The following is the complete SAS code to generate a web presentation. Note the following:

  • The HTMLFILE= parameter specifies the name of the HTML file to be produced by DS2CSF. If you want to run this sample, then change the value of HTMLFILE = to something that makes sense for you.

  • The data set variable X specifies the value to be displayed on the CSF diagram. In this case, the critical value equals 0.8.

  • The parameter

     range=sashelp.javagrf.sample1.range 

    specifies a range entry that defines the range segments and their corresponding color. In this case, the range entry defines three segments: 0 “0.33, 0.33 “0.66, and 0.66 to 1.

  • The data set variable X specifies the value to be displayed on the CSF diagram. In this case, the critical value equals 0.8.

 data test; x=0.8; label x=Current Probability; run;  title RangeViewApplet Sample - Classic CSF;  %ds2csf(data=test,          var=x,          htmlfile=  your_path_and_filename  .htm,          openmode=replace, pagepart=head,          center=y,  it is not in the same directory as the html file */          archive=http://  your_path_to_archive  ,          csftyp=classic, septype=none, cback=#e0e0e0,          bgtype=color, bg="#e0e0e0",          ttag=bold + italicized, tcolor="#002288", tsize=5,          tface="Arial, Helvetica",          range=sashelp.javagrf.sample1.range);  title RangeViewApplet Sample - Digital CSF;  %ds2csf(data=test,          var=x,          htmlfile=  your_path_and_filename  .htm,          openmode=append, pagepart=foot,          center=y,          archive=rvapplet.jar,          /* specify complete url if not in same directory as the html file */          archive=http://  your_path_to_archive  ,          csftyp=digital, labelpos=Bottom_Center, cback=#e0e0e0,          bgtype=color, bg="#e0e0e0",          ttag=bold + italicized, tcolor="#002288", tsize=5,          tface="Arial, Helvetica",          range=sashelp.javagrf.sample1.range); 

Adding a Link to a Critical Success Factor Diagram

You can add a hotspot to a diagram created with the DS2CSF macro. However, unlike the Treeview and Constellation macros, you can add only a single hotspot to a diagram, that is, to the diagram as a whole. You can not add hotspots to different portions of the diagram.

SAS Code

The SAS code creates a diagram and links to the specified URL when a user clicks anywhere on the diagram. DRILURL= specifies the URL to link to, while DRILTARG=_self specifies that the new Web page is to be displayed in the same window as the diagram.

 data test; x=0.8; label x='Current Probability'; run;  title 'RangeViewApplet Sample - Classic CSF';  %ds2csf(data=test,          var=x,          htmlfile=  your_path_and_filename  .htm,          openmode=replace, pagepart=head,          center=y,        drilurl=http://www.xyz.com,          archive=rvapplet.jar,          /* specify complete url if not in same directory as the html file */          archive=http://  your_path_to_archive  ,          csftyp=classic, septype=none, cback=#e0e0e0,          bgtype=color, bg="#e0e0e0",          ttag=bold + italicized, tcolor="#002288", tsize=5,          tface="Arial, Helvetica",          range=sashelp.javagrf.sample1.range); 



SAS.GRAPH 9.1 Reference, Volumes I and II
SAS.GRAPH 9.1 Reference, Volumes I and II
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 342

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net