|
|||
|
I would like to save the titles and footnotes as my program executes,
change them, and later restore the saved titles and footnotes. It has been pointed out here in the past that SASHELP.VTITLE does not supply enough information to exactly reproduce the TITLES and FOOTNOTE statements. The closest I have come to finding a solution that preserves the titles exactly is the output from PROC GOPTIONS FOOTNOTE; Has anyone else done save and restore title and footnotes? Its not something that I need to do on a regular basis but it seems like it might be a nice tool to have handy when you do need it. At first I thought I would need a data step to read the file created by PROC PRINTTO and filter out the SASLOG titles and notes but using nonotes, nosource, page; and skip; I got a clean file that could be %incuded. This clean log may not hold up in all situations. Please advise as I had hoped for an easier method. The test program: options ps=40 ls=64; title1 ' This is right Justified'; title2 'This is left justified '; title3 'This is centered'; footnote1 ' This is right Justified'; footnote2 'This is left justified '; footnote3 'This is centered'; /* save titles and footnotes */ options ls=256 nosource nonotes; page; skip 1; proc printto new log='log.tmp';run; proc goptions nolist footnote;run; proc printto;run; options ls=64 source notes; /* reset titles and footnotes*/ title1 'Titles are reset'; footnote1 'Reset'; proc print data=sashelp.class;run; /* restore the titles */ %inc "log.tmp" / source2; proc print data=sashelp.class;run; |
|
|
||||
|
||||
|
|
|
|||
|
data _null_; wrote:
> I would like to save the titles and footnotes as my program executes, > change them, and later restore the saved titles and footnotes. > > It has been pointed out here in the past that SASHELP.VTITLE does not > supply enough information to exactly reproduce the TITLES and FOOTNOTE > statements. > > The closest I have come to finding a solution that preserves the > titles exactly is the output from PROC GOPTIONS FOOTNOTE; Some factors contributing to this Dr.Jekyll and Dr.Jekyller is that Base and Graph are separate products. A title with graphics options is 'not understood' by ODS LISTING, but is by ODS anything else -or- Proc <GRAPHICS PROCEDURE> Consider this beaut: goptions reset=all; title1 j=l f='Arial' c=red "Left" j=c h=18pt c=blue "Middle" j=r bc=lig box=1 angle=45 h=13pct "Right"; proc gslide;run; filename TFS CATALOG 'WORK.TFS.STORAGE.SOURCE'; Proc PRINTTO PRINT=TFS; RUN; Proc GOPTIONS TITLE NOLIST NOLOG; RUN; Proc PRINTTO PRINT=PRINT; RUN; Creates a nearly useable file for later %INCLUDE. However, there is an annoying unsubmittal statement when there are no titles or footnotes. And futherworse, the quotes are removed from the true type font specification. All in all, not very promising. VTITLE only delivers the text that will be rendered as the title, nothing about the rendering options. So again, not helpful. It seems a lobbyist for Proc GOPTSAVE and GOPTLOAD is needed. I wouldn't be surprised if there were 500 metadata elements contributing to the state of the graphics environment. DSGI has some limited ability to interact with the graphics system via GASK, but there is nothing for titles. For now the best advice is don't get into a situation where you need to push and pop graphics titles, footnotes, axis, symbols, legends, etc... -- Richard A. DeVenezia http://www.devenezia.com/ |
|
|||
|
>Richard A. DeVenezia: Wrote:
>Creates a nearly useable file for later %INCLUDE. However, there is an >annoying unsubmittal statement when there are no titles or footnotes. And >futherworse, the quotes are removed from the true type font specification. >All in all, not very promising. Good points thank you pointing out these situations I had not considered. Seems these problems can be solved with a bit of processing before the include. When there are no titles or footnotes SASHELP.VTITLE has 0 observations. The unquoted font is a bit harder. I'm probably wrong but, it looks to me like the only time the font needs to be quoted is when it is more than one word. 'Bookman old style' for example. If so it seems a reqular expression could be written to add the needed quotes. Thanks again for you insightfull reply. |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: Save and restore titles and footnotes. | Quentin McMullen | Newsgroup comp.soft-sys.sas | 1 | 05-04-2005 11:01 PM |
| Re: Save and restore titles and footnotes. | Fehd, Ronald J | Newsgroup comp.soft-sys.sas | 0 | 05-04-2005 08:58 PM |