Architecting, installing and maintaining your SAS environment

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

Reply
Occasional Contributor
Posts: 11

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

     

     

hi,

length ab  8

format ab  BEST15.

informat ab BEST15.

ab variable is a  part of Input_Data

     

16         proc summary data=Input_Data;

17          by GENERAL_LEDGER_NUMBER EXCO_CODE COMPANY_DIVISION_CODE;

18          var ab;

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

19         

20          

21          output out=Data sum=DATA_TOTAL;

22         run;

I need your help on this how to resolve this.I tried format statement as well as input not working...can you provide tested code..Thanks in advance

Super User
Posts: 10,552

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

Format won't change a variable from character to numeric. The variables on the VAR statement in Proc Means/Summary must be numeric in the input dataset. The values may look numeric but I bet if you run Proc contents on your Input_data set that it will show variable ab as character.

And if there are actually 15 digits you're possibly going to run into precision limitations.

Moderator
Posts: 238

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

Agree with - sounds like your "AB" variable is character, in which case your data step will need to convert it to a numeric using the input() function.

data MyOutputData;

set MyInputData; /* Which contains the (presumably character) variable AB */

format ab  BEST15.; /* Your choice of format is actually irrelevant for this exercise */

  ab_num = input(ab,best15.); /* Note: The INFORMAT you choose will depend on the character "layout" - I've guessed BEST. here);

drop ab; /* Optional */

run;

proc summary..... etc.

If this does not help, please post the results of a PROC CONTENTS, plus the first few rows of a PROC PRINT of the AB variable.

Occasional Contributor
Posts: 11

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

Thank you all for your valuable comments...I got the clue..its resolved now

Moderator
Posts: 238

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

Could you please share your final result?

Ask a Question
Discussion stats
  • 4 replies
  • 2100 views
  • 2 likes
  • 3 in conversation