INPUTN Function
Enables you to specify a numeric informat at run time.
| Category: | Special |
|---|---|
| Returned data type: | DOUBLE |
Table of Contents
Syntax
Required Arguments
source
specifies a character constant, variable, or expression to which you want to apply the informat.
| Data type | CHAR |
|---|
informat
is a character constant, variable, or expression that contains the numeric informat that you want to apply to source.
| Data type | CHAR |
|---|
Optional Arguments
w
is a numeric constant, variable, or expression that specifies a width to apply to the informat.
| Interaction | If you specify a width here, it overrides any width specification in the informat. |
|---|---|
| Data type | DOUBLE |
d
is a numeric constant, variable, or expression that specifies the number of decimal places to use.
| Interaction | If you specify a number here, it overrides any decimal-place specification in the informat. |
|---|---|
| Data type | DOUBLE |
Comparisons
The INPUTC function enables you to specify a character informat at run time. Using the PUT function is faster because you specify the informat at compile time.
Example
The following program illustrates how to specify numeric informats.
proc ds2;
data _null_;
method init();
declare double salary;
salary = inputn('20,000.00', 'comma10.2');
put salary=;
end;
enddata;
run;
quit;
SAS writes the following output to the log:
20000
See Also
-
Functions: