SAS - 带有更改书签的 pdf 输出 [英] SAS - pdf output with changed bookmarks

查看:10
本文介绍了SAS - 带有更改书签的 pdf 输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题如下 - 我有两个数据集,我通过宏循环 2 * 2 图表从中创建.我将这两个图绘制到 pdf 文件中,第 1 页上的前 2 个图和第 2 页上的其他图.

My problem is as follows - I have two datasets, out of which I create through macro loop 2 * 2 graphs. I plot these two graphs into the pdf file having the first 2 graphs on the page 1 and the other graphs on the page 2.

输出 pdf 很好,我唯一想更改的是书签.我希望它们包含有关图表的一些详细信息 - 每个图表都有一个单独的原始书签.

The output pdf is fine, the only thing I would like to change are bookmarks. I would like them to contain some detailed information about the graphs - one separate original bookmark per each graph.

有没有一些简单的方法可以做到这一点?我通过 proc 报告找到了一些复杂的解决方案,但是我当前的代码有什么简单的方法吗?

Is there some simple way how to do that ? I have found out some complicated solutions through proc report, but is there any easy way for my current code ?

data out_i_a; set sashelp.retail; run;
data out_ii_b; set sashelp.retail; run; 

data y;
length saz tef $100;
input saz $ tef $; 
datalines;
i a 
ii b
;
run;

%macro grafy();
proc sql;
 select count(*) into: pocet from y;
quit;

ods _all_ close;
goptions hsize=20cm vsize=8cm;
ods pdf file="\srv05
t05aGRAFTOT_testing.pdf";
ods layout gridded columns=1;


%do i=1 %to &pocet;
data _null_;
  set y (obs=&i);
 call symput("saz" ,strip(saz));
 call symput("tef" ,strip(tef));
run;

ods region;
ods pdf text="&saz._&tef";
symbol1 interpol=join height=10pt VALUE=NONE LINE=1 WIDTH=1 CV= _STYLE_;
symbol2 interpol=join height=10pt VALUE=NONE LINE=1 WIDTH=1 CV= _STYLE_;
Legend1 value=('SALES' 'YEAR');
axis1 label=('# sales');
axis3 label=('# year');
axis2 label=('date');
proc gplot data= out_&saz._&tef;
plot (SALES)*DATE   / overlay skipmiss
VAXIS=AXIS1 
HAXIS=AXIS2 LEGEND=Legend1;
plot2 (YEAR)*DATE / overlay skipmiss
VAXIS=AXIS3
HAXIS=AXIS2 LEGEND=Legend1;
run;

ods region;
symbol1 interpol=join height=10pt VALUE=NONE LINE=1 WIDTH=1 CV= _STYLE_;
symbol2 interpol=join height=10pt VALUE=NONE LINE=1 WIDTH=2 CV= _STYLE_;
Legend1 value=('year' 'month');
axis1 label=('in %, p.a.');
axis2 label=('date');
proc gplot data= out_&saz._&tef;
 plot (YEAR MONTH)*DATE   / overlay skipmiss
 VAXIS=AXIS1 
 HAXIS=AXIS2 LEGEND=Legend1;
run;
%end;

ods layout end;
ods pdf close;

%mend;
%grafy();

当前书签 - 要更改 - 是自动创建的,如下所示:

The current bookmarks - to be changed - are created automatically and are as follows:

GPlot 过程 - 按 DATE 的年份图

The GPlot Procedure - Plot of YEAR by DATE

GPlot 过程 - 按日期绘制 MONTH

The GPlot Procedure - Plot of MONTH by DATE

GPlot 过程 - 按 DATE 的年份图

The GPlot Procedure - Plot of YEAR by DATE

GPlot 过程 - 按日期绘制 MONTH

The GPlot Procedure - Plot of MONTH by DATE

推荐答案

  • 在每个 Proc GPLOT 之前,您可以发出 ODS PROCLABEL 语句来替换书签顶层显示的默认文本.
  • /description= 添加到每个 PLOT 语句以指定书签二级文本.
    • Before each Proc GPLOT you can issue an ODS PROCLABEL statement to replace the default text shown in the bookmarks top level.
    • Add / description= to each PLOT statement to specify the bookmark second level text.
    • 例如:

      ODS PROCLABEL "&saz &tef SALES";  /* ADD THIS */
      
      proc gplot data= out_&saz._&tef;
      plot (SALES)*DATE   / overlay skipmiss
      
      DESCRIPTION = "by Date" /* ADD THIS */
      
      VAXIS=AXIS1 
      HAXIS=AXIS2 LEGEND=Legend1;
      plot2 (YEAR)*DATE / overlay skipmiss
      VAXIS=AXIS3
      HAXIS=AXIS2 LEGEND=Legend1;
      

      这篇关于SAS - 带有更改书签的 pdf 输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆