Using value type input parameters in a SAS Data Function.
book
Article ID: KB0080336
calendar_today
Updated On:
Products
Versions
Spotfire Statistics Services
All supported versions
Description
Using value type input parameters in a SAS Data Function.
Issue/Introduction
Using value type input parameters in a SAS Data Function.
Environment
All supported environments
Resolution
To reference a Value type input parameter within SAS code, you will need to reference it as a macro variable. For example, for an input Value named "test", you would need to reference this as &test in SAS code. This is discussed in further detail in the TIBCO Spotfire Statistics Services User's Guide, section "Spotfire Data Inputs and Outputs for SAS":
------------------------------------------------- A “value” data function input is interpreted differently than a “table” or “column” input. Rather than using the single scalar value to create a SAS data set, it is used to define a SAS macro variable whose name is the data function input variable, and whose value is the character string produced from the Spotfire scalar value. Using macro variables is a common way to parameterize SAS scripts, which matches the purpose of Spotfire “value” inputs.
For example, if you define a “value” input named “filename”, and its value is the string “D:/temp.txt”, then the following macro variable definition is added to the beginning of the SAS script:
%LET filename D:/temp.txt;
This macro variable can be referenced within the SAS script using SAS code such as the following, which reads from the specified text file, producing the output data set “filedata”.
DATA filedata; INFILE '&filename'; INPUT A $ B $ Num; RUN; -------------------------------------------------