BookmarkSubscribeRSS Feed
Afor910327
Obsidian | Level 7

Hi,

 

How could I stop getting this error, when I keep getting the following error with the code below:

 

MPRINT(SERIES): data tempsas.itemACPSA_partial_combine;

MPRINT(SERIES): set tempsas.itemACPSA_partial_combine_0 tempsas.itemACPSA_Interp;

ERROR: Variable y1998 has been defined as both character and numeric.

ERROR: Variable y1999 has been defined as both character and numeric.

ERROR: Variable y2000 has been defined as both character and numeric.

ERROR: Variable y2001 has been defined as both character and numeric.

ERROR: Variable y2002 has been defined as both character and numeric.

ERROR: Variable y2003 has been defined as both character and numeric.

ERROR: Variable y2004 has been defined as both character and numeric.

ERROR: Variable y2005 has been defined as both character and numeric.

ERROR: Variable y2006 has been defined as both character and numeric.

ERROR: Variable y2007 has been defined as both character and numeric.

ERROR: Variable y2008 has been defined as both character and numeric.

ERROR: Variable y2009 has been defined as both character and numeric.

ERROR: Variable y2010 has been defined as both character and numeric.

ERROR: Variable y2011 has been defined as both character and numeric.

ERROR: Variable y2012 has been defined as both character and numeric.

NOTE: The SAS System stopped processing this step because of errors.

WARNING: The data set TEMPSAS.ITEMACPSA_PARTIAL_COMBINE may be incomplete. When this step was stopped there were 0 observations

and 27 variables.

NOTE: DATA statement used (Total process time):

real time 0.01 seconds

cpu time 0.00 seconds

 

--------------------------------------------------------------------------------------------------------------------

data tempsas.current_item_concordance;

set concord.&acpsaitemcc;

 

proc sort data=tempsas.current_item_concordance out=tempsas.current_item_concordance_sort;

by itemCode itemACPSA;

run;

data tempsas.itemACPSA_partial_combine_0;

length itemCode $ 20 itemDescr $ 300 itemACPSA $ 9 itemACPSADescr $ 90;

 

set tempsas.itemACPSA_23 tempsas.itemACPSA_3X tempsas.itemACPSA_51 tempsas.itemACPSA_54 tempsas.itemACPSA_56 tempsas.itemACPSA_61 tempsas.itemACPSA_71 tempsas.itemACPSA_81 tempsas.itemACPSA_99;

where upcase(isInterp) ne 'Y';

format itemCode $20. itemDescr $300. itemACPSA $9. itemACPSADescr $90.;

 

data tempsas.itemACPSA_partial_combine;

set tempsas.itemACPSA_partial_combine_0 tempsas.itemACPSA_Interp;

proc sort data=tempsas.itemACPSA_partial_combine out=tempsas.itemACPSA_partial_combine_sort;

by itemCode itemACPSA;

proc summary data=tempsas.current_item_concordance_sort;

by itemCode;

id itemDescr;

var weight;

output out=tempsas.current_item_concordance_sum(drop=_type_) sum= ;

run;

 

2 REPLIES 2
kiranv_
Rhodochrosite | Level 12

same variable names have different  datatypes in your different datasets, hence the error. You need to fix the variables to  have same data type to avoid this error.

PeterClemmensen
Tourmaline | Level 20

The error messages are pretty self explanatory here. The variables y1998-y2012 are defined in one location as numeric and in another as character. PROC CONTENTS is your friend in this type of problem. 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1261 views
  • 0 likes
  • 3 in conversation