Ad Hoc Reports

Overview of Ad Hoc Reports

To create an ad hoc report, you must first write a SAS report program. When the report code is ready, you copy your code to the SAS Editor tab in the Create an Ad Hoc Report window. You then submit your program. Unlike the user-defined report, the ad hoc report does not require auxiliary files to be uploaded to the SAS Content Server.
To create your report output in either HTML, PDF, or RTF, or to specify a style other than the default style for your report, you modify your report with code that is provided by SAS and that enables you to specify the report output format and style. The code that you need to add to your program is included in the steps to create an ad hoc program.
If you find an error in your report code, you must delete the report in the project, fix your code in your source file, and submit the code in the Create an Ad Hoc Report window again.

Create an Ad Hoc Report

To create an ad hoc report, you must first create a SAS program. Test your program in SAS before you run your program as an ad hoc report. After the code runs successfully, you can create the ad hoc report.
To create an ad hoc report:
  1. On the Reports page, click New report and select Ad Hoc. The Create an Ad Hoc Report window appears.
    Create an Ad Hoc Report
  2. Enter a name and an optional description for the report.
  3. Select one or more models.
  4. Add or copy SAS code to the SAS Editor tab. Make sure that your report program is enclosed by the SAS code that defines the report output format. Click the Macro Variables tab to view a list of the variables that can be accessed by your program.
  5. Click Run. The report is generated and appears in the default viewer for the selected output type.
  6. The report appears in a list on the Model Evaluation reports tab.

Example Ad Hoc Report

The following example code lists the score results in an HTML output format:
Filename mmreport catalog "sashelp.modelmgr.reportexportmacros.source";
%include mmreport;

%MM_ExportReportsBegin(reportFormat=html, reportStyle=Meadow, fileName=PerfDS); 
proc print data=myTable.scoretable;
var loan delinq score;
run;
quit;


%MM_ExportReportsEnd(reportFormat=html);
After you click Run, the report is created and placed on the Reports page. The following HTML output displays selected rows of the output.
Ad Hoc Example Output
Last updated: February 22, 2017