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. 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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