Reads percentage data in the specified locale for local expressions,
and then converts the data to a numeric value.
-
w
-
specifies the width of the input field.
-
d
-
optionally specifies whether to divide
the number by 10d. If the data contains
decimal separators, the d value is ignored.
The NLPCTw.d informat reads percentage data in the specified locale for
local expressions, and then converts the data to a numeric value. It divides
the value by 100 and removes any thousands separators, decimal separators,
blanks, the percent sign, and the close parenthesis from the input data.
The NLPCTw.d informat performs processing that is opposite of the
NLPCTIw.d informat. The NLPCTw.d informat is similar to the
PERCENTw.d informat
except that the NLPCTw.d
informat is locale-specific.
The following example uses -12,345.67% as the input
value.
Statements |
Result |
|
----+----1----+
|
options LOCALE=English_UnitedStates;
x=input('-12,345.67%',nlpct32.2);
y=input('(12,345.67%)',percent32.2);
put x=;
put y=;
|
-123.4567
-123.4567
|
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.