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
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.
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.
Thank you all for your valuable comments...I got the clue..its resolved now
Could you please share your final result?
The SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment.
SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.
Find more tutorials on the SAS Users YouTube channel.