Statistical programming, matrix languages, and more

ANother Error

Posts: 38

ANother Error

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

Posts: 3,628

Re: ANother Error

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.

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation