不知何故,我无法在SAS PDF输出的第二页上显示标题。我的代码(就标题声明而言)与我之前编写的一个运行良好的程序几乎完全相同。页面1完全按照预期工作,但是页面2根本没有显示任何标题,尽管我做了各种努力。下面是我认为应该可以工作的代码。为了更容易阅读,我去掉了大部分的实际信息,但由于某种原因,如果proc报告或proc sgplot中的任何内容可能会影响页面上的标题,请告诉我,我可以分享更多。谢谢你的帮助。
ods pdf file="location/name";
footnote "footnote";
ods escapechar='^';
ods pdf startpage=now;
options orientation=portrait nodate;
title1 '^S={Preimage="image"}';
title2 height=12pt bold 'Page 1 title' ;
proc report data= data1
/*variables and stuff*/
run;
ods pdf startpage = no;
proc report data= data2
/*variables and stuff*/
run;
ods pdf startpage=no;
proc report data=data3
/*variables and stuff*/
run;
ods pdf startpage=no;
proc report data=data4
/*variables and stuff*/
run;
title1;
title2;
*****Page 2;
ods pdf startpage=now;
options orientation=portrait;
title3 'Page 2 Title';
proc sgplot data=data5;
/*variables and stuff*/
run;
ods pdf startpage=no;
proc sgplot data=data6 ;
/*variables and stuff*/
run;
title3;
ods pdf close;发布于 2021-06-25 03:08:37
我认为改变标题是不可能的-- PDF中的标题更像是PDF级别的。
看看this question on SAS Communities,我认为解决这个问题的最好方法是使用ODS TEXT,它可以让你在页面上放置任意的文本。
--
编辑: Reeza说得对;这是非常有可能的,只要每个页面都有一个新的进程。只需确保NOGTITLE,这样图片就不会吞噬你的标题。
发布于 2021-06-25 03:30:27
指定NOGTITLE选项。第二个页面全是图形,标题嵌入到图形标题中(图片中),而不是传递到PDF文件。仅供参考-使用单个ODS PDF语句而不是多个语句来设置选项是一种好的做法,因为这样您就可以覆盖以前的设置。
这对我很有效。
ods pdf file="/home/fkhurshed/Demo1/test.pdf" startpage=now;
footnote "footnote";
ods escapechar='^';
options orientation=portrait nodate;
title1 'Dummy Title';
title2 height=12pt bold 'Page 1 title' ;
proc report data= sashelp.class (obs=2);
/*variables and stuff*/
/*variables and stuff*/
run;
ods pdf startpage = no;
proc report data= sashelp.class (obs=4);
/*variables and stuff*/
/*variables and stuff*/
run;
ods pdf startpage=no;
proc report data=sashelp.class (obs=3);
/*variables and stuff*/
run;
ods pdf startpage=no;
proc report data=sashelp.class (obs=2) ;
/*variables and stuff*/
run;
*****Page 2;
ods pdf startpage=now gtitle;
options orientation=portrait;
title1 'Page 2 Title';
proc sgplot data=sashelp.stocks ;
where stock = "IBM";
series x=date y=high;
run;
ods pdf startpage=no;
proc sgplot data=sashelp.stocks ;
where stock = "IBM";
series x=date y=high;
run;
title3;
ods pdf close;https://stackoverflow.com/questions/68120795
复制相似问题