sas infile dataline trunctuates at 8 characters

Viewed 1159

Having not worked with SAS for a couple of years, i am trying to get back into it...

I am trying to read data with comma-delimited datalines. While there are plenty of examples, I can't quite get the following to import my data correctly:

data h0;
   infile datalines delimiter=','; 
   input
   kst
   kst_bez $
   hx $
   hx_bez $
   hxx $
   hxx_bez $
   hxxx $
   hxxx_bez $
;
   datalines;
10000,Team 1 South,H0,Group,H10,Retail,H112,Retail Germany
10001,Team 2 North & West,H0,H10,Retail Division 2,H112,Retail Germany
10003,Human Res,H0,Group,H20,HR,H112,HR Germany
;

I would have thought that delimiter=',' tells SAS to simply read the data between my ,-Characters into something like a VARCHAR-variable... however, any alphanumeric data is truncated at 8 characters.

I vaguely remember I have to use something like $varying40., which is in line with the examples I found - however, if I add this to my variables, the variable doesn't stop at the ,, but instead reads the whole, say, 40 characters.

Any hints?

Thanks a ton!

1 Answers
Related