05-14-2016 06:47 AM
Dear SAS community,
I am using SAS EG to build reports in HTML. In the GUI, I have the possibility to add a title to my report. Do you know if it is possible to use a macro variable for the title? I indeed have to create tens of reports, and it is a bit bunrdensome to write manually the title for each report generated.
In advance, thank you,
05-14-2016 10:20 AM
Personally, I think that EG is the ideal tool for code development, and for one-off exploratory analytics.
In your case, of operationalizing a repetitive action, I think you might be happier if you used the EG facilities to create a "model" of your reporting process, but then capture the code and create your process in code, either in EG or in one of the production-oriented tools like DIS. Then, you'll have full access to all of the automation, macro, and scheduling facilities that you might require.
05-14-2016 12:41 PM
05-14-2016 04:14 PM
Yes, those sneaky devils (that's YOU, @ChrisHemedinger), made it a little different in Query Builder.
Get your query set up just the way you need, and then click the Preview button. That will show you the generated code.
05-16-2016 07:11 PM
Then, once you have the code you like for your report from the GUI, you can customize the titles to include whatever macro variable you would like. here's an example that inserts the report date into a title:
data _null_; /* define report date macro variable as two days ago */ call symput('rpt_date',put(date()-2,date9.)); run; %put &rpt_date; TITLE1 JUSTIFY=left "Here's the overall report title."; TITLE3 JUSTIFY=center "Particular report on &rpt_date."; proc report data=infile; run; title; /* clear titles with blank title statement or update title for next report */
05-17-2016 02:33 AM
Thanks a lot Tom for your time,
Nevertheless I did not manage to find the code...
For the query builder I can find it (preview, or open the table and click on the tab 'code'. But for the 'report' functionality (File<New<Report...), the preview button does not show any code, just the chart.
I fear that the code cannot be accessed...
05-17-2016 08:58 AM
My apologies, I thought you were asking about the Query Builder.
No, I don't know how to access the facilities that create reports in EG. I've never used this part of the product.
Hopefully, someone else will be able to give some good suggestions!