SAS Web Report Studio enables you to include seven dynamic text items in a header or footer (for a list, see SAS Note 20902). Another way to add dynamic text items to a header or footer is to place a Text object just below the header or just above the footer. Text objects can display measure and prompt values.
This sample explains how you can use SAS® Information Studio in order to create a measure data item that represents today's date. That measure is then inserted into a Text object that is placed directly beneath the report's header. In this way, it appears that today's date is part of the report's header.
Tip: Beginning with the second maintenance release for SAS Web Report Studio 4.31, you can insert prompt values into headers and footers.
This sample was written using the first maintenance release for SAS Information Map Studio 4.31. However, you can perform this task with version 3.1 and later. For version 3.1, the user interface is slightly different.
To create the Price Data information map used in the sample, you can submit the PROC INFOMAPS code on the Full Code tab in this sample. The steps in the sample refer to this information map.
Note: The TODAY function produces the current date in the form of a SAS date value, which is the number of days since January 1, 1960.
This what the layout looks like.
Click View to display the report.
The DATETIME function produces the current date and time of day as a SAS value that represents the number of seconds between January 1, 1960, and the current time. The TIME function produces the current time of day as a SAS time value. To create data items that represent the current date and time and the current time, follow the steps for creating today's date, but use these settings:
Setting | Current Time | Current Date and Time |
---|---|---|
Function | TIME() | DATETIME() |
Formatting | Date/Time and TIME | Date/Time and DATETIME |
For more information about SAS Web Report Studio, see the SAS Web Report Studio documentation page.
For more information about SAS Information Map Studio, see the SAS Information Map Studio 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.
Before submitting this code, these tasks must be done:
Note: For information about registering SAS libraries and tables, see Establishing Connectivity to a Library of SAS Data Sets.
/* This syntax is for use with SAS 9.2 or later */
%let mpath=/Shared Data/your-map-folder;
proc infomaps metauser="your-userID"
metapass="your-password"
metaserver="your-metadata-server.com"
metaport=8561
metarepository=Foundation
mappath="&mpath";
new infomap "Prices" auto_replace=yes;
insert datasource
sasserver="SASApp"
table="yourlib".pricedata
id="Prices";
insert dataitem column="Prices"."date"
id="Date";
insert dataitem column="Prices"."sale"
id="Unit Sale";
insert dataitem column="Prices"."regionName"
id="Region";
insert dataitem column="Prices"."productName"
id="Product";
save;
* list _all_;
run;
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 |
Topic: | Data Management ==> Data Sources ==> Information map Query and Reporting ==> Interactive Querying Query and Reporting SAS Reference ==> Functions ==> Date and Time ==> DATE SAS Reference ==> Functions ==> Date and Time ==> DATETIME SAS Reference ==> Functions ==> Date and Time ==> TIME SAS Reference ==> Functions ==> Date and Time ==> TODAY |
Date Modified: | 2012-08-01 15:04:43 |
Date Created: | 2008-05-06 16:03:53 |
Product Family | Product | Host | Product Release | SAS Release | ||
Starting | Ending | Starting | Ending | |||
SAS System | SAS Information Map Studio | Microsoft® Windows® for x64 | 3.1 | 9.1 TS1M3 SP4 | ||
Microsoft Windows 2000 Advanced Server | 3.1 | 9.1 TS1M3 SP4 | ||||
Microsoft Windows 2000 Datacenter Server | 3.1 | 9.1 TS1M3 SP4 | ||||
Microsoft Windows 2000 Server | 3.1 | 9.1 TS1M3 SP4 | ||||
Microsoft Windows 2000 Professional | 3.1 | 9.1 TS1M3 SP4 | ||||
Microsoft Windows NT Workstation | 3.1 | 9.1 TS1M3 SP4 | ||||
Microsoft Windows Server 2003 Datacenter Edition | 3.1 | 9.1 TS1M3 SP4 | ||||
Microsoft Windows Server 2003 Enterprise Edition | 3.1 | 9.1 TS1M3 SP4 | ||||
Microsoft Windows Server 2003 Standard Edition | 3.1 | 9.1 TS1M3 SP4 | ||||
Microsoft Windows XP Professional | 3.1 | 9.1 TS1M3 SP4 | ||||
SAS System | SAS Web Report Studio | Microsoft® Windows® for x64 | 3.1 | 9.1 TS1M3 SP4 | ||
Microsoft Windows 2000 Advanced Server | 3.1 | 9.1 TS1M3 SP4 | ||||
Microsoft Windows 2000 Datacenter Server | 3.1 | 9.1 TS1M3 SP4 | ||||
Microsoft Windows 2000 Server | 3.1 | 9.1 TS1M3 SP4 | ||||
Microsoft Windows 2000 Professional | 3.1 | 9.1 TS1M3 SP4 | ||||
Microsoft Windows NT Workstation | 3.1 | 9.1 TS1M3 SP4 | ||||
Microsoft Windows Server 2003 Datacenter Edition | 3.1 | 9.1 TS1M3 SP4 | ||||
Microsoft Windows Server 2003 Enterprise Edition | 3.1 | 9.1 TS1M3 SP4 | ||||
Microsoft Windows Server 2003 Standard Edition | 3.1 | 9.1 TS1M3 SP4 | ||||
Microsoft Windows XP Professional | 3.1 | 9.1 TS1M3 SP4 | ||||
64-bit Enabled AIX | 3.1 | 9.1 TS1M3 SP4 | ||||
64-bit Enabled Solaris | 3.1 | 9.1 TS1M3 SP4 | ||||
HP-UX IPF | 3.1 | 9.1 TS1M3 SP4 |