Returns the transcode attribute of a SAS data set variable.
Category: |
Variable Information
|
VARTRANSCODE(data-set-id,
var-num)
|
- data-set-id
-
specifies the data set identifier that the OPEN function
returns.
- var-num
-
specifies the position of the variable in the SAS data set.
Tip: |
The VARNUM function returns this value. |
Transcoding is the process of converting data from one
encoding to another. The VARTRANSCODE function returns 0 if the var-num variable does not transcode its value, or 1 if the var-num variable
transcodes its value.
For more information about transcoding variables, see Transcoding in
SAS National Language Support (NLS): Reference Guide. For information about encoding values and transcoding
data, see SBCS, DBCS, and Unicode Encoding Values When
Transcoding SAS Data in
SAS National Language Support (NLS): Reference Guide.
The following example shows how to determine whether a character variable
is transcoded:
data a;
attrib x length=$3. transcode=no;
attrib y length=$3. transcode=yes;
x='abc';
y='xyz';
run;
data _null_;
dsid=open('work.a','i');
nobs=attrn(dsid,"nobs");
nvars=attrn(dsid,"nvars");
do i=1 to nobs;
xrc=fetch(dsid,1);
do j=1 to nvars;
transcode = vartranscode(dsid,j);
put transcode=;
end;
end;
run;
SAS writes the following output to the log:
transcode=0
transcode=1
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.