程序如下,是摘抄的网上的示例——
/* 1. Define the name and storage location of the HTML output file */
/* and the location of the jar files. */
%let htmlfile = "d:\temp.htm";
%let jarfiles = "D:\Program Files\SASHome\SASGraphJavaApplets\9.4";
/* 2. Define a data set that contains parent-child relationships. */
data myorg;
input name $ empno mgrno deptname $22. deptcode $;
cards;
Peter 2620 1420 Documentation DOC
Linda 6915 1420 Research & Development R&D
Maria 1320 1420 Legal LGL
Vince 1420 1750 Executive EXE
Jim 6710 6915 Quality Assurance QA
Nancy 22560 6915 Quality Assurance QA
Patrick 28470 6915 Quality Assurance QA
Elsa 33075 6915 Development DEV
Clement 22010 6915 Development DEV
Murielle 3020 6915 Development DEV
David 11610 6915 Research RES
;
run;
/* 3. Specify titles and footnotes: (optional). */
title1 'Organizational Chart';
footnote1 'To display the department name, place the cursor over a node.';
footnote2 'To rotate the chart, click and drag a node.';
/* 4. Run the DS2TREE macro. */
/* You must change the CODEBASE= argument (using either http:// */
/* or a directory path such as C:/) to specify the location of your */
/* sas.graph.treeview.jar file and its associated jar files */
/* (sas.graph.nld.jar, sas.graph.j2d.jar). See the CODEBASE= argument in: */
/* Programming with the DS2TREE Macro for the Treeview Applet.*/
/* (Make sure that ods listing is open when running macro.) */
ods listing;
%ds2tree(ndata=myorg, /* data sets and files */
codebase=&jarfiles,
xmltype=inline,
htmlfile=&htmlfile,
nid=empno, /* roles of variables */
nparent=mgrno,
ntip=deptname,
nlabel=name,
height=500, /* appearance */
width=600,
tcolor=navy,
fcolor=black);