I have created a Teradata table as below create multiset table d_test.test_char_length (
contract_id int
,var1 varchar(5) character set latin
,var2 varchar(5) character set unicode
)unique primary index(contract_id)
; Inserted a dummy row as below insert into d_test.test_char_length values (123,'home','home'); Below is the SAS code to read the Teradata table and PROC CONTENTS on the table in Teradata and in SAS. data test_char_length;
set d_test.test_char_length;
run;
proc contents data=d_test.test_char_length;
run;
proc contents data=test_char_length;
run; Below is the output 10:14 Tuesday, October 16, 2018 1
The CONTENTS Procedure
Data Set Name D_TEST.test_char_length Observations .
Member Type DATA Variables 3
Engine TERADATA Indexes 0
Created . Observation Length 0
Last Modified . Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation Default
Encoding Default
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat Label
1 contract_id Num 8 11. 11. contract_id
2 var1 Char 10 $10. $10. var1
3 var2 Char 15 $15. $15. var2
10:14 Tuesday, October 16, 2018 2
The CONTENTS Procedure
Data Set Name WORK.TEST_CHAR_LENGTH Observations 1
Member Type DATA Variables 3
Engine V9 Indexes 0
Created 10/16/2018 10:22:00 Observation Length 40
Last Modified 10/16/2018 10:22:00 Deleted Observations 0
Protection Compressed NO
Data Set Type Sorted NO
Label
Data Representation SOLARIS_X86_64, LINUX_X86_64, ALPHA_TRU64, LINUX_IA64
Encoding utf-8 Unicode (UTF-8)
Engine/Host Dependent Information
Data Set Page Size 65536
Number of Data Set Pages 1
First Data Page 1
Max Obs per Page 1632
Obs in First Data Page 1
Number of Data Set Repairs 0
Filename /saswork/SAS_work0E0F00005108_sas-compute/SAS_workD74B00005108_sas-compute/test_char_length.sas7bdat
Release Created 9.0401M4
Host Created Linux
Inode Number 4063249
Access Permission rw-r--r--
Owner Name unxsrv
File Size 128KB
File Size (bytes) 131072
Alphabetic List of Variables and Attributes
# Variable Type Len Format Informat Label
1 contract_id Num 8 11. 11. contract_id
2 var1 Char 10 $10. $10. var1
3 var2 Char 15 $15. $15. var2 My question is why the length of var1 (LATIN encoding in Teradata) in SAS is 10 instead of 5 and var2 (UNICODE encoding in Teradata) is 15 instead of 5. I was expecting var1 to be 5 and var2 to be 10 in SAS. Regards, Shakir
... View more