- 阅读权限
- 255
- 威望
- 0 级
- 论坛币
- 5054 个
- 通用积分
- 2.3322
- 学术水平
- 107 点
- 热心指数
- 96 点
- 信用等级
- 90 点
- 经验
- 9453 点
- 帖子
- 300
- 精华
- 1
- 在线时间
- 735 小时
- 注册时间
- 2010-3-25
- 最后登录
- 2020-8-3
讲师
还不是VIP/贵宾
- 威望
- 0 级
- 论坛币
- 5054 个
- 通用积分
- 2.3322
- 学术水平
- 107 点
- 热心指数
- 96 点
- 信用等级
- 90 点
- 经验
- 9453 点
- 帖子
- 300
- 精华
- 1
- 在线时间
- 735 小时
- 注册时间
- 2010-3-25
- 最后登录
- 2020-8-3
|
20论坛币
大家好,以下程序是sas帮助文件中的例子,利用sas画社交网络图,但是产生的htm文件在打开的时候,图却显示不了,如下所示
不知该如何解决,不知道大家有没有遇到这种情况,如果有,该如何解决,谢谢!
- /* Define the path to the archive file, the HTML output file, and the SAS
- library */
- proc options option=appletloc;
- run;
- %let jarfiles = d:\Program Files\SASHome\SASGraphJavaApplets\9.3;
- %let htmlfile = d:\html-filename.htm;
- %let lib = WORK; /* put everything in the WORK library */
- /* Define the node names and locations. */
- data &lib..regions;
- length regionName $80 /* Node text label */
- regionId $4 /* Node identifying string */
- xLoc yLoc 8; /* Pixel position of node */
- input regionID xLoc yLoc reserve RegionName $ &;
- cards;
- PNW 30 30 8.5 Western Systems Coordinating Council - Pacific Northwest
- NWPE 100 60 8.5 Western Systems Coordinating Council - Northwest Power Pool East
- CALI 40 220 9.5 Western Systems Coordinating Council - California
- RMPA 140 180 10.8 Western Systems Coordinating Council - Rocky Mountain Power Area
- AZNM 110 310 12.9 Western Systems Coordinating Council - AZNMSNV
- MAPP 180 80 15 Mid-continent Area Power Pool
- SPPN 185 200 13.6 Southwest Power Pool - North
- SPPS 170 270 13.6 Southwest Power Pool - South
- ERCT 180 400 15 Electric Reliability Council of Texas
- WUMS 270 90 17 Wisconsin - Upper Michigan
- MANO 290 240 17 Mid-America Interconnected Network - South
- ENTG 290 360 12.4 Entergy
- MECS 350 130 15 Michigan Electric Coordination System
- ECAO 360 200 15 East Central Area Reliability Coordination Agreement - South
- TVA 360 300 12.4 Tennessee Valley Authority
- SOU 390 400 12.4 Southern Company
- FRCC 420 460 15 Florida Reliability Coordinating Council
- VACA 450 340 12.4 Virginia and Carolinas
- MACS 460 280 19 Mid-Atlantic Area Council - South
- MACE 495 235 19 Mid-Atlantic Area Council - East
- MACW 430 220 19 Mid-Atlantic Area Council - West
- UPNY 450 160 18 Upstate New York
- DSNY 500 170 18 Downstate New York
- NYC 530 200 18 New York City
- LILC 570 170 18 Long Island Lighting Company
- NENG 570 90 18 New England Power Pool
- ;
- run;
- /* Define the node connections. */
- data &lib..links;
- length from to $4 ltip $12 lcolor $8;
- format capacity comma.;
- input from to capacity;
- lcolor = "#BBBBBB"; /* Light gray lines */
- ltip = left(put(capacity, comma.) || " MW"); /* Define the tool tips */
- if capacity < 500 then width = 1; /* Define the line widths */
- else if capacity < 1000 then width = 2;
- else if capacity < 2000 then width = 3;
- else if capacity < 3000 then width = 4;
- else width = 5;
- cards;
- MECS ECAO 2250
- ECAO MECS 2250
- ECAO MACW 2957
- ECAO MANO 1655
- ECAO TVA 1890
- ECAO VACA 2334
- ERCT SPPS 635
- MACE MACW 1500
- MACE DSNY 1130
- MACS MACW 1800
- MACS VACA 3075
- MACW ECAO 2612
- MACW MACE 3368
- MACW MACS 3075
- MACW UPNY 481
- MANO ECAO 3033
- MANO WUMS 608
- MANO MAPP 531
- MANO SPPN 1191
- MANO TVA 2207
- MANO ENTG 1245
- WUMS MANO 1080
- WUMS MAPP 676
- MAPP MANO 1150
- MAPP WUMS 324
- MAPP SPPN 1172
- MAPP ENTG 1000
- MAPP NWPE 150
- MAPP RMPA 233
- NENG DSNY 1425
- UPNY MACW 1418
- UPNY DSNY 3750
- DSNY LILC 788
- DSNY MACE 308
- DSNY NENG 1125
- DSNY UPNY 3750
- DSNY NYC 3750
- NYC LILC 788
- NYC DSNY 3750
- LILC DSNY 938
- LILC NYC 788
- SPPN MANO 1228
- SPPN MAPP 891
- SPPN SPPS 525
- SPPN ENTG 636
- SPPS ERCT 569
- SPPS ENTG 636
- SPPS SPPN 900
- SPPS AZNM 315
- SPPS ENTG 1200
- ENTG SOU 1136
- ENTG TVA 1278
- ENTG MANO 1399
- ENTG SPPS 292
- ENTG SPPN 292
- ENTG MAPP 856
- SOU FRCC 4516
- SOU TVA 1810
- SOU VACA 1346
- SOU ENTG 1902
- FRCC SOU 21
- TVA ECAO 2235
- TVA MANO 2331
- TVA SOU 2052
- TVA ENTG 2153
- TVA VACA 2261
- VACA ECAO 2822
- VACA MACS 2794
- VACA SOU 3042
- VACA TVA 2240
- CALI PNW 4922
- CALI AZNM 0
- CALI NWPE 1184
- PNW CALI 5903
- PNW NWPE 1050
- RMPA MAPP 233
- RMPA AZNM 518
- RMPA NWPE 413
- NWPE RMPA 413
- NWPE CALI 1574
- NWPE MAPP 113
- NWPE AZNM 840
- NWPE PNW 2145
- AZNM CALI 5663
- AZNM NWPE 638
- AZNM RMPA 518
- AZNM SPPS 315
- ;
- run;
- /* Close the ODS HTML destination and open the ODS LISTING destination. */
- ods html close;
- ods listing;
- /* Set chart title. */
- title1 "Electric Power Regional Interconnections";
- title2 "Created with SAS/GRAPH Constellation Applet";
- footnote1 "Link: Base Electricity Transfer Capacity";
- footnote2 "Node: Generation Reserve Margin";
- /* Use the DS2CONST macro to generate the chart. */
- %ds2const(/* Arguments for the Applet Tag */
- codebase=&jarfiles, /* Path to archive file */
- height=520, /* Applet window height */
- width=600, /* Applet window width */
- /* Arguments for Data Definition */
- datatype=assoc, /* Size nodes by nvalue var */
- nsize=reserve, /* Node sizes */
- ncolval=reserve, /* Node colors */
- layout=user, /* Use nx/ny to position nodes */
- nx=xLoc, /* x-coordinate of node */
- ny=yLoc, /* y-coordinate of node */
- lcolor=lcolor, /* Link color */
- lvalue=width, /* Link values */
- lwidth=width, /* Link widths */
- minlnkwt=0, /* Sets minimum link weight displayed*/
- labels=y, /* Display node labels */
- linktype=line, /* Do not show flow direction */
- ndata=&lib..regions, /* Node data */
- ldata=&lib..links, /* Node linkage data */
- nid=regionID, /* Var for node ID string */
- nlabel=regionID, /* Var for node label string */
- lfrom=from, /* Var for from-node ID */
- lto=to, /* Var for to-node ID */
- ntip=RegionName, /* Var for popup node text */
- ltip=ltip, /* Var for popup line text */
- /* Arguments for Generating HTML and XML Files */
- htmlfile=&htmlfile, /* Output file name */
- openmode=replace, /* Create a new html file */
- /* Arguments for Diagram Appearance */
- nodeshap=circle, /* Node shape */
- border=y, /* Enclose diagram */
- colormap=y, /* Use colormap for link/node colors */
- fntsize=14, /* Node label font size */
- fntstyl=plain, /* Node label font style */
- /* Arguments for Page Formatting */
- bgtype=color, /* Use page background color */
- bg=#DDDDDD, /* The page background color */
- center=y, /* Center chart on the page */
- septype=none, /* No separator line */
- /* Arguments for the SAS TITLE and FOOTNOTE Tags */
- tcolor=#0000FF, /* Title text color */
- fcolor=#0000FF, /* Footnote text color */
- tsize=3, /* Title text size */
- fsize=2); /* Footnote text size */
- /* Close ODS LISTING and open ODS HTML. */
- ods listing close;
- ods html;
复制代码
另外,我试了其它的画图输出,结果也是这种情况,打开htm文件输出图出现错误。
- /* Create the temporary data set named sales. */
- data sales;
- length Region $ 4 State $ 2;
- format Sales dollar8.;
- input Region State Sales Year Qtr;
- datalines;
- West CA 13636 1999 1
- West OR 18988 1999 1
- West CA 14523 1999 2
- West OR 18988 1999 2
- East MA 18038 1999 1
- East NC 13611 1999 1
- East MA 11084 1999 2
- East NC 19660 1999 2
- West CA 12536 1998 1
- West OR 17888 1998 1
- West CA 15623 1998 2
- West OR 17963 1998 2
- East NC 17638 1998 1
- East MA 12811 1998 1
- East NC 12184 1998 2
- East MA 12760 1998 2
- ;
- /* Specify the JAVA device for generating the chart. */
- goptions reset=all border device=java;
- /* Close the current ODS HTML destination. */
- ods html close;
- /* Open the HTML destination. Specify vbarweb.htm as */
- /* the output filename and GEARS as the style. */
- ods html file="d:\vbarweb.htm" style=listing;
- /* Generate the bar chart. Group by YEAR and subgroup */
- /* by STATE. */
- title "Company Sales, Mid Year";
- proc gchart data=sales;
- vbar3d region / sumvar=sales
- group=year subgroup=state;
- run;
- quit;
- /* ODS html to close the output file, and then reopen ODS HTML. */
- ods html close;
- ods html;
复制代码
|
|