BookmarkSubscribeRSS Feed
goliPSU
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;

    use CONVENTIONAL;

    /* 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));

error:

431  print FV_sectors;

432      use CONVENTIONAL;

433

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

1 REPLY 1
Rick_SAS
SAS Super FREQ

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 */
use sashelp.cars;
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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 818 views
  • 0 likes
  • 2 in conversation