Date: Mon, 22 May 2000 14:43:57 -0400
Reply-To: WHITLOI1 <WHITLOI1@WESTAT.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: WHITLOI1 <WHITLOI1@WESTAT.COM>
Subject: Re: SAS Version 8.00 Tip: sashelp.vcolumn/name
Content-Type: text/plain; charset=US-ASCII
Mark,
Remember, the case in V8 is dedetermined by the VALIDVARNAME option. Thus
options validvarname = upcase ;
will store all name in upper case and return them as upper case. Of course,
there
may be problems with code not allowing enough length and perhaps utility code
should
not resort to the use of VALIDVARNAME. So your principle is well worth noting
for
writing good code or updating old code, but a quick fix is available for those
who
can afford to postpone reworking old code.
Ian Whitlock <whitloi1@westat.com>
PS. Here is macro to return the standard length of names during this chaotic
period.
/* Return maximum length of variable (or format) names */
%macro WNameLen ( type = VAR /* VAR or FMT gives type of name */
) ;
/* ------------------------------------------------------------
MODULE: WNAMELEN
PURPOSE: Return maximum length of valid SAS name.
CLASS: Macro function. May appear as part of a statement.
USAGE: length name $ %wnamelen() ; * V6 and V7 ok ;
%if %length(&name) > %wnamelen() %then
%put ERROR: Name (&name) too long.
PARAMETERS: type=VAR Specifies type of name (VAR or FMT)
SIDE EFFECTS: None.
SYSTEMS: All (tested WIN).
HISTORY: 23jun1998 IW
DOCUMENT: Here.
SUPPORT: Ian Whitlock <whitloi1@westat.com>
------------------------------------------------------------
*/
%if %upcase(&type) = FMT %then 8 ;
%else
%if %sysevalf ( &sysver < 7 ) %then 8 ;
%else
%if %upcase(%sysfunc (getoption(validvarname))) = V6 %then 8 ;
%else 32 ;
%mend wnamelen ;
Format name lengths are included in the hopes that SI may mend the errant ways
on this subject in the near future, while I want to have the code ready to
take advantage of that today.
____________________Reply Separator____________________
Subject: SAS Version 8.00 Tip: sashelp.vcolumn/name
Author: "Terjeson; Mark" <TERJEMW@DSHS.WA.GOV>
Date: 5/22/2000 10:43 AM
FYI
Something I found back in February,
but I will send it around again.
SAS Version 8.00 Tip:
If you have any code written with sashelp.vcolumn please read on, else
disregard.
In Version 6.12 (and earlier versions) view-table sashelp.vcolumn, the
'name' column contents are uppercase. In Version 8.00 the 'name' column
contents are *mixedcase*. You
may need to adjust your source code by incorporating the upcase() function
if necessary.
Hope this is helpful,
Mark Terjeson
Washington State Department of Social and Health Services
Division of Research and Data Analysis (RDA)
(360) 902-0741
(360) 902-0705 fax
mailto:terjemw@dshs.wa.gov