I would like to replace the hard-coded text in my code. A file in txt format should fill-in the text.
I'm looking for a an %include statement.
Is this possible?
I've found a reference which lools promising. But I can't get it work.
https://support.sas.com/resources/papers/proceedings09/222-2009.pdf
ods escapechar='^';
proc odstext;
p '01. ^{style[textdecoration=underline fontsize=14pt]Problem statement:} ^{newline 1} ^{style[color=blue ]Maintenance contracts have a significant share in the
portfolio of VWFS. During their lifetime they cause expenses to VWFS. Their cost pattern depends on many factors making it difficult to measure and compare.
As the pricing is furthermore subject to numerous specific contract and vehicle criteria, the interpretation of the economic result becomes even more complex.
} ^{newline 2}';
p '02. ^{style[textdecoration=underline fontsize=14pt]What was done and how:} ^{newline 1} ^{style[color=blue ]We accumulated all costs and incomes (through monthly rate) for any given
contract in the Portfolio during its lifetime. These events were expanded to a timeseries so that a contracts result can be assessed at any point of time, real=past and
estimated=future. Advanced algorithms estimate each variables contribution to the observed results thus making it possible to compare the result between subjects.
} ^{newline 2}';
run;
Hi:
I suspect the reason the example in the paper didn't work is that the paper was written back in 2009 and I believe that the tagset templates have changed since the paper was written. I think that using a TAGSET template for this type of thing is too complicated an approach. As @Reeza suggests, using a macro variable is one way to do it and is also the first way I would approach a challenge like this.
Cynthia
PS...As an additional comment, I rarely would accept input from users without some heavy validation and checking first. So at the very least, unless you really really trust these users and are training them very well, I would have them place their additional comments in a file or location where you can find them and check them before you turn your process/program loose on input from end users.
Hi:
Again, you'd probably have to use a macro variable. There is not a way to put the output object name into a caption using ODS TEXT automatically. You'd have to capture the name of the object, create a macro variable and then use the macro variable in the caption. But have you tried ODS PROCLABEL? The PROC label is the ODS way of typically using the self-announcing procedure title "The MEANS Procedure", "The TABULATE Procedure", etc in any table of contents. So if you used your macro variable in an ODS PROCLABEL you might not need ODS TEXT for your caption. Still using a macro variable, but possibly making it easier to generate your TOC with ODS WORD.
Cynthia
PS. I still get messages that ODS WORD is preproduction in the SAS 9.4M7 log, so my tendency would be to stick with ODS RTF if this is production work. Using either ODS WORD or ODS RTF, I can use ODS PROCLABEL to impact the TOC, as shown below:
I still have to manually do an "Update Field" to build the TOC when Word opens the created file. But now I'm sort of backpedaling on whether you'd really need a macro variable. Proc Means always creates MEANS.SUMMARY and most of the procedures have fixed paths, so while you could put the output object name in the caption, it might make more sense for you to use figure numbers and generally accepted descriptions for the Figures by hard-coding ODS PROCLABEL before each PROC step. I guess I'm still not clear on what you really need to generate, but I found a lot of good ODS WORD and TOC information in this paper: https://www.sas.com/content/dam/SAS/support/en/sas-global-forum-proceedings/2020/4265-2020.pdf .
Cynthia
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.