DATA Step, Macro, Functions and more

ERROR: Variable biomf in list does not match type prescribed for this list.

Reply
New Contributor
Posts: 3

ERROR: Variable biomf in list does not match type prescribed for this list.

I have imported a file that has column names. One of them is biomf and bourgf. I then want to analyse the data in those columns but it says 

ERROR: Variable biomf in list does not match type prescribed for this list. (The same for bourgf)

 

/** Import an XLSX file. **/

PROC IMPORT DATAFILE="/folders/myshortcuts/Myfolders/D_2015.xlsx"
OUT=WORK.chiend15
DBMS=XLSX
REPLACE;
RUN;

/** Print the results. **/

PROC PRINT DATA=WORK.chiend15; RUN;

 

proc glm data=work.chiend15;
class trt bloc;
model biomf bourgf=trt bloc;
means trt;

Occasional Contributor
Posts: 11

Re: ERROR: Variable biomf in list does not match type prescribed for this list.

what are the formats for these two variables? I would guess that SAS is importing them as characters or something unexpected.

New Contributor
Posts: 3

Re: ERROR: Variable biomf in list does not match type prescribed for this list.

SAS is importing them as alphanumeric...

Occasional Contributor
Posts: 11

Re: ERROR: Variable biomf in list does not match type prescribed for this list.

were you expecting them to be continuous? can i have an example of what your data looks like?

New Contributor
Posts: 3

Re: ERROR: Variable biomf in list does not match type prescribed for this list.

it worked when i changed the data in excel from 6.08 to 6,08 for example so now it reads the data as numeric data ! 

 

Occasional Contributor
Posts: 11

Re: ERROR: Variable biomf in list does not match type prescribed for this list.

nice, i knew something was off with the data import. glad the results are as expected now.

Super User
Posts: 10,550

Re: ERROR: Variable biomf in list does not match type prescribed for this list.

When using Proc Import with XLS and XLSX files the Excel data engine looks at the first few rows of data and then describes that to SAS. If any of the first few rows has something that might be interpretted as character, even just a second row of column headings, then the data will be treated as text not numeric.

 

You might want to consider running Proc Contents after any import of XLS or XLSX using Proc Import to see if the variables are as you expect.

 

Also a common issue when going to combine multiple files that you think have the same layout is one import with character and another with numeric in the same column, which will cause errors when combining, or different lengths for character variables which will generate warnings and possibly result in truncated data.

Super User
Posts: 9,691

Re: ERROR: Variable biomf in list does not match type prescribed for this list.

Maybe variable biomf turn into CHARACTER not NUMERIC .

Ask a Question
Discussion stats
  • 7 replies
  • 311 views
  • 0 likes
  • 4 in conversation