Desktop productivity for business analysts and programmers

Enterprise guide - report - title - macrovariable

Reply
Contributor
Posts: 20

Enterprise guide - report - title - macrovariable

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,

PROC Star
Posts: 1,146

Re: Enterprise guide - report - title - macrovariable

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.

 

Tom

Contributor
Posts: 20

Re: Enterprise guide - report - title - macrovariable

Thanks Tom for your answer,
Do you know how to extract the code for the report generation? I couldn't find a tab code as displayed in the query builder, this is my issue.
Thank you very much and kind regards,
Tanguy
PROC Star
Posts: 1,146

Re: Enterprise guide - report - title - macrovariable

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.

 

Tom

Occasional Contributor k_o
Occasional Contributor
Posts: 5

Re: Enterprise guide - report - title - macrovariable

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 */

 

Contributor
Posts: 20

Re: Enterprise guide - report - title - macrovariable

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...

PROC Star
Posts: 1,146

Re: Enterprise guide - report - title - macrovariable

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!

 

Best,

  Tom

Ask a Question
Discussion stats
  • 6 replies
  • 365 views
  • 1 like
  • 3 in conversation