Checks the validity of a character string for use as a SAS variable name.
| Category: | Character |
| Restriction: | I18N Level 0 functions are designed for use with Single Byte Character Sets (SBCS) only. |
is a character constant, variable, or expression that specifies one of the following values:
determines that string is a valid SAS variable name if it contains 32 or fewer characters of any type, including blanks.
determines that string is a valid SAS variable name if it is in the form of a SAS name literal ('name'N) or if it is a valid SAS variable name when VALIDVARNAME=V7.
| See | V7 above in this same list. |
| Default | If no value is specified, the NVALID function determines that string is a valid SAS variable name based on the value of the SAS system option VALIDVARNAME=. |
options validvarname=v7 ls=64;
data string;
input string $char40.;
v7=nvalid(string,'v7');
any=nvalid(string,'any');
nliteral=nvalid(string,'nliteral');
default=nvalid(string);
datalines;
Tooooooooooooooooooooooooooo Long
OK
Very_Long_But_Still_OK_for_V7
1st_char_is_a_digit
Embedded blank
!@#$%^&*
"Very Loooong N-Literal with """N
'No closing quotation mark
;
proc print noobs;
title1 'NLITERAL and Validvarname Arguments Determine';
title2 'Invalid (0) and Valid (1) SAS Variable Names';
run;