Sometimes you might want to use the value entered for a prompt as input to another data item expression. This sample explains how you can accomplish this goal using a SAS® Stored process to generate a SAS macro variable, which can then be used in an expression. Your task is to create a new data item where the value is 30 days before the date entered for the prompt.
Note: This sample was written using SAS® Management Console 9.2 and SAS Information Map Studio 4.2; however, you should also be able to perform this task in version 3.1.
As the input table for the information map, this sample uses the SASHELP.PRDSAL3 table. The steps in the sample refer to this data.
options symbolgen;
*Processbody;
%stpbegin;
%global indate;
/* ************************************************************************* */
/* The prompt value is stored in "indate". Subtract 30 days
from that date and put the value in "mydate" */
/* ************************************************************************* */
data _NULL_;
call symput("mydate",put(intnx('day',"&indate"d,-30),date9.));
|
Note: If you are creating the stored process in SAS 9.3, then, in SAS Management Console, right-click on the stored process and select Make Compatible. Using the Make Compatible option is the easiest way to ensure that stored processes created with SAS 9.3 can be used with information maps.
The value of this new data item will be a constant value of 30 days prior to the date entered for the stored process prompt.
For more information on using an existing stored process within an information map, see Sample 39432.
For more information about SAS Information Map Studio, see the SAS Information Map 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 |
Topic: | Data Management ==> Data Sources ==> Information map SAS Reference ==> Macro |
Date Modified: | 2010-07-20 14:41:55 |
Date Created: | 2010-07-19 17:07:59 |
Product Family | Product | Host | Product Release | SAS Release | ||
Starting | Ending | Starting | Ending | |||
SAS System | SAS Information Map Studio | Microsoft® Windows® for x64 | 4.2 | 9.2 TS2M0 | ||
Microsoft Windows Server 2003 Datacenter Edition | 4.2 | 9.2 TS2M0 | ||||
Microsoft Windows Server 2003 Enterprise Edition | 4.2 | 9.2 TS2M0 | ||||
Microsoft Windows Server 2003 Standard Edition | 4.2 | 9.2 TS2M0 | ||||
Microsoft Windows Server 2003 for x64 | 4.2 | 9.2 TS2M0 | ||||
Microsoft Windows Server 2008 for x64 | 4.2 | 9.2 TS2M0 | ||||
Microsoft Windows XP Professional | 4.2 | 9.2 TS2M0 | ||||
Windows Vista | 4.2 | 9.2 TS2M0 | ||||
Windows Vista for x64 | 4.2 | 9.2 TS2M0 |