INPUTC Function
Enables you to specify a character informat at run time.
| Categories: | Special |
| CAS | |
| Note: | This function supports the VARCHAR type. |
Syntax
Required Arguments
source
specifies a character constant, variable, or expression to which you want to apply the informat.
informat
is a character constant, variable, or expression that contains the character informat that you want to apply to source.
Optional Argument
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. |
Details
Example
proc format;
value typefmt 1='$groupx'
2='$groupy'
3='$groupz';
invalue $groupx 'positive'='agree'
'negative'='disagree'
'neutral'='notsure';
invalue $groupy 'positive'='accept'
'negative'='reject'
'neutral'='possible';
invalue $groupz 'positive'='pass'
'negative'='fail'
'neutral'='retest';
run;
data answers;
input type response $;
respinformat=put(type, typefmt.);
word=inputc(response, respinformat);
datalines;
1 positive
1 negative
1 neutral
2 positive
2 negative
2 neutral
3 positive
3 negative
3 neutral
;agree. The value
of WORD for the last observation is retest.