Hi, I have a problem when importing data from ACCESS table which takes multiple values.
One of the questions in the access form was:
What is (are) your favorite fruit? The coding of the answer are 1=Apple, 2=Orange, 3=Banana, 4=Melon, 5=Mango, 6=Strawberry. Respondents are allowed to choose all that applies, so if they pick more than one choice the data will be stored as 3,4,6 for example. However when I imported the database to SAS format, it only takes the first value (‘3’) but not whole value string (‘3,4,6’).
I tried and created an access db with only 6 records and it works fine with either proc import or the libname statement, also SAS 9.2 TS2M3. I do notice that your extension is accdb though and not sure what the difference is, mine is mdb.
Two possibilities, check how SAS is displaying this variable, it may have read it in right, but have the wrong format set.
Or if the first time this happens is later in the dataset and you might need to play with the guessing rows options similar to excel.
I exported the database to a text file and found that the data was stored in a text field as "3;4;6”.
Not sure if that matters, but the answers were associated with another table which store the underlying coding ; ie. when one select Banana, Melon and Strawberry in the form, it will be stored as “3;4;6” as above.
SAS was able to read it as Character field and displayed as a single digit character (length=3 format=$3. Informat=$3.) in the SAS viewer. However the PROC FREQ procedure suggested the frequency as follow (the layout is edited to fit the display on this forum). :