When you schedule a report, you must specify a value for each prompt in the report. In order to change the prompt values for a scheduled report, you must edit the job by using the Schedule Report wizard. This sample explains how you can use a prompt file to modify the prompts without using the wizard. A prompt file can be used in these two ways.
Note: This sample also can be used for distributions.
C:\SAS\EBIserver\Lev1\ReportBatch\rptbatch.bat --spring-xml-file file:C:\SAS\EBIserver\Lev1\Applications\SASBIReportServices4.3\spring.xml
--repository Foundation --source "A5IFORTX.BQ00001A" --burst --channel-age 90
--metadata-key "BurstDefinition+omi://Foundation/reposname=Foundation/Transformation;id=A5IFORTX.B10000C4"
|
--extract
and --source
. The following example shows a modified copy of the string shown in step 3.
C:\SAS\EBIserver\Lev1\ReportBatch\rptbatch.bat --extract --spring-xml-file
file:C:\SAS\EBIserver\Lev1\Applications\SASBIReportServices4.3\spring.xml --repository Foundation
--source "SBIP://METASERVER/Shared Data/Reports/prdsale_Olap_Date_prompt_Report.srx"
--username sasdemo --password {sas002}6FE4B62647E0E59721B8CAD44A81057C --prompts-file c:\prompt\DatePromptfile2.xml
|
This string includes the following new commands:
--extract
extracts the prompt file.--source
is the name of the scheduled report, and is case sensitive.--username
and --password
are the credentials under which to run the command.--prompts-file
specifies the location and name of the extracted prompt file.c:\prompt\DatePromptfile2.xml
.
Troubleshooting
Typically, if the prompt file is not created then there was a problem with your modified command line. In particular, do not insert more than one space between arguments. |
<?xml version="1.0" encoding="UTF-8"?>
<ReportParameters version="1.2" xmlns:style="http://www.sas.com/sasreportmodel/styles" xmlns:esri="http://www.sas.com/sasreportmodel/esri">
<ReportParameter visible="false" ID=".R_ELMT_1222201021383550266..DatePrompt">
<OLAPMemberName obj="p1" uniqueMemberName="[date dim].[All datedim].[03/01/1997]" version="1.0">
<Label><Text obj="p2" xml:lang="en-US">03/01/1997</Text></Label></OLAPMemberName>
</ReportParameter>
</ReportParameters>
|
You derive the final command string by taking the original command string from step 3 and appending the prompt file definition as shown below.
C:\SAS\EBIserver\Lev1\ReportBatch\rptbatch.bat --spring-xml-file file:C:\SAS\EBIserver\Lev1\Applications\SASBIReportServices4.3\spring.xml
--repository Foundation --source "A5IFORTX.BQ00001A" --burst --channel-age 90
--metadata-key "BurstDefinition+omi://Foundation/reposname=Foundation/Transformation;id=A5IFORTX.B10000C4"
--prompts-file c:\prompt\DatePromptfile2.xml
|
If you are using the Platform Suite for SAS, then you must select the Advanced button on the Scheduling Details tab in order to add the prompt file path.
CAUTION: If you subsequently edit the schedule using the wizard in SAS Web Report Studio, your modified command will be overwritten.
You also can submit the string on a command line.
You can dynamically update the prompt
file. In this sample, the prompt has a date value in the form mm/dd/yyyy. You can dynamically update this date prompt to always use today's date. The following sample code below assumes that your prompt file is named mypromptfile.xml
. The code does the following.
/* Note: Before attempting to run this code. Make a backup of your prompt file */
/* get the value of today's date and put it into a SAS Macro variable called today */
data _NULL_;
today = put(today(),mmddyy10.);
call symput("today",today);
run;
%let promptfile =C:\prompt\mypromptfile.xml; /* prompt file */
%let dest=C:\prompt\mypromptfile2.xml;
filename Dest "&dest";
data _NULL_;
infile "&promptfile" recfm=v firstobs=1 Truncover;
input string $400.;
file Dest ;
/* search for a pattern that matches the form mm/dd/yyyy
and then replace it with today's date */
rx=rxparse("$d$d '/' $d$d '/' $d$d$d$d TO '&today'");
CALL RXCHANGE(rx, 9999, string);
put string;
output;
run;
filename Dest clear;
/* Write the destination file back to the original prompt file */
filename Dest "&promptfile";
data _NULL_;
infile "&dest" recfm=v firstobs=1 Truncover;
input text $400.;
file Dest ;
put text;
output;
run;
|
For more information about scheduling servers, see Configuring a Scheduling Server
For more information on the command-line arguments, see Processing Reports Outside of SAS Web Report Studio .
For more information about SAS Web Report Studio, see the SAS Web Report Studio documentation page.
For more information about SAS Management Console, see the SAS Management Console documentation page.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Type: | Sample |
Date Modified: | 2011-01-12 11:39:58 |
Date Created: | 2011-01-06 13:27:03 |
Product Family | Product | Host | Product Release | SAS Release | ||
Starting | Ending | Starting | Ending | |||
SAS System | SAS Web Report Studio | Microsoft® Windows® for x64 | 4.3 | 9.2 TS2M3 | ||
Microsoft Windows Server 2003 Datacenter Edition | 4.3 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2003 Enterprise Edition | 4.3 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2003 Standard Edition | 4.3 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2003 for x64 | 4.3 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2008 | 4.3 | 9.2 TS2M3 | ||||
Microsoft Windows Server 2008 for x64 | 4.3 | 9.2 TS2M3 | ||||
Microsoft Windows XP Professional | 4.3 | 9.2 TS2M3 | ||||
Windows 7 Enterprise 32 bit | 4.3 | 9.2 TS2M3 | ||||
Windows 7 Enterprise x64 | 4.3 | 9.2 TS2M3 | ||||
Windows 7 Home Premium 32 bit | 4.3 | 9.2 TS2M3 | ||||
Windows 7 Home Premium x64 | 4.3 | 9.2 TS2M3 | ||||
Windows 7 Professional 32 bit | 4.3 | 9.2 TS2M3 | ||||
Windows 7 Professional x64 | 4.3 | 9.2 TS2M3 | ||||
Windows 7 Ultimate 32 bit | 4.3 | 9.2 TS2M3 | ||||
Windows 7 Ultimate x64 | 4.3 | 9.2 TS2M3 | ||||
Windows Vista | 4.3 | 9.2 TS2M3 | ||||
Windows Vista for x64 | 4.3 | 9.2 TS2M3 | ||||
64-bit Enabled AIX | 4.3 | 9.2 TS2M3 | ||||
64-bit Enabled Solaris | 4.3 | 9.2 TS2M3 | ||||
HP-UX IPF | 4.3 | 9.2 TS2M3 | ||||
Linux for x64 | 4.3 | 9.2 TS2M3 | ||||
Solaris for x64 | 4.3 | 9.2 TS2M3 |