BookmarkSubscribeRSS Feed
Calcite | Level 5

I have the FV_sectors (It has values as I have printed it), and the data in CONVENTION has icom and ccom where in some places I have icom which is including numbers in FV_sectors. I do not want to include them in SECTOR_LIST. but it is giving me the following error:

    print FV_sectors;


    /* list of all commodities */

    read all var{cCom iCom} into SECTOR_LIST where ((iCom ^= FV_sectors)&(cCom ^= FV_sectors));

    num_sectors = sqrt(nrow(SECTOR_LIST));


431  print FV_sectors;

432      use CONVENTIONAL;


434      /* list of all commodities */

435      read all var{cCom iCom} into SECTOR_LIST where ((iCom ^= FV_sectors)&(cCom ^=

435! FV_sectors));

ERROR: Type mismatch in WHERE clause for variable iCom.

statement : READ at line 435 column 5

436      num_sectors = sqrt(nrow(SECTOR_LIST));

Thank you


Here's a debugging tip: Try to reproduce your error on a standard SASHELP data set such as Sashelp.Class or Sashelp.Cars.  Often this will enable you to figure out what is going on because the sample data is (a) familiar and (2) simple. Furthermore, even if you can't figure it out yourself, you'll be able to post an example that others can actually run, which will make it easier for them to debug.

For this example, I saw that the error says "type mismatch," which usually means comparing a numeric quantity with a character quantity.  Since I don't have your data, I don't know what types they are, but I was able to reproduce the problem with Sashelp.Class:

proc iml;
c = "USA"; /* character value */
read all var{mpg_city} into X where(mpg_city^= c);

I suspect that  iCom is numeric whereas FV_Section is character, or vice versa.



Time is running out to save with the early bird rate. Register by Friday, March 1 for just $695 - $100 off the standard rate.


Check out the agenda and get ready for a jam-packed event featuring workshops, super demos, breakout sessions, roundtables, inspiring keynotes and incredible networking events. 


Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 1 reply
  • 2 in conversation