Usage Note 37386: New SAS® Stored Process prompts in SAS® 9.2: Data source and Data source item - Usage Example
In SAS® 9.2, the Data source and Data source item SAS® Stored Process prompts are available. These new prompts are documented in the
SAS® 9.2 Stored Processes: Developer's Guide
in the
Macro Variables That Are Generated from Prompts section.
The %metadata_getDatafileFromPath macro can be used in your SAS Stored
Process code to retrieve metadata information for the prompt values.
The following example SAS Stored Process code illustrates the use of
this macro. Here are some comments about the SAS Stored Process code.
- A Data source prompt called datasrc needs
to be defined for the SAS Stored process using SAS® Management Console since this
is the name that is used in the example SAS Stored Process code ( referenced as &datasrc ).
- The datasrc_type parameter is automatically created and
passed to the SAS Stored Process. This parameter is associated
with the datasrc prompt. Note that the first portion
of the name is the same, followed by _type.
- Possible datasrc_type values (which represent the type of the data source).
datasrc_type=1 represents a SAS Table
datasrc_type=2 represents a Cube
datasrc_type=4 represents a Relational Information Map
datasrc_type=8 represents an OLAP Information Map
- The output is stored in a SAS® data set called mytable.
- The assignlib=y parameter is required.
- You can retrieve metadata information about a Data source item
prompt in the same manner as a Data source prompt.
/* This SAS Stored Process retrieves metadata for a Data Source */
/* and saves the output in a SAS® data set using the */
/* %metadata_getDatafileFromPath macro. */
/* */
/* Input Parameters: &DATASRC, &DATASRC_TYPE */
/* Output Parameters: MYTABLE */
*ProcessBody;
%METAAUTO;
%metadata_getDatafileFromPath(path=&DATASRC,
type=&DATASRC_TYPE,
assignlib=y,
outvar=MYTABLE,
debug=y);
%stpbegin;
proc print data=&MYTABLE(obs=25) label;
run;
%stpend;
Operating System and Release Information
SAS System | SAS Integration Technologies | z/OS | 9.2 TS2M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.2 TS2M0 | |
Microsoft Windows XP 64-bit Edition | 9.2 TS2M0 | |
Microsoft® Windows® for x64 | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.2 TS2M0 | |
Microsoft Windows XP Professional | 9.2 TS2M0 | |
Windows Vista | 9.2 TS2M0 | |
64-bit Enabled AIX | 9.2 TS2M0 | |
64-bit Enabled HP-UX | 9.2 TS2M0 | |
64-bit Enabled Solaris | 9.2 TS2M0 | |
HP-UX IPF | 9.2 TS2M0 | |
Linux | 9.2 TS2M0 | |
Linux for x64 | 9.2 TS2M0 | |
OpenVMS on HP Integrity | 9.2 TS2M0 | |
Solaris for x64 | 9.2 TS2M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
In SAS® 9.2, the Data Source and Data source item
prompts are available.
The %metadata_getDatafileFromPath macro can be used in your SAS Stored Process code to retrieve information about the the data source.
Date Modified: | 2009-10-09 16:02:27 |
Date Created: | 2009-10-08 12:16:02 |