<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Error in assiging a variable in IML in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Error-in-assiging-a-variable-in-IML/m-p/98219#M706</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;below is the part of my code:&lt;/P&gt;&lt;P&gt;proc iml&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let yr = '1993';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nonMakeInd = {192}; /*Identify empty rows of the Make matrix*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use CxC_ind;&lt;/P&gt;&lt;P&gt;read all var {FMB_IO} into CxC;&lt;/P&gt;&lt;P&gt;num_com = nrow(CxC);&lt;/P&gt;&lt;P&gt;print num_com;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*-----------------------------------------------------------------------------*/&lt;/P&gt;&lt;P&gt;/*-----------------------------------------------------------------------------*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*DEFINE, LOCATE matrix positions of sets and subsets */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use Zcom;&lt;/P&gt;&lt;P&gt;read all var {FMBCOM} into sector_list where (stat_year = &amp;amp;yr);&lt;/P&gt;&lt;P&gt;num_sectors = nrow(SECTOR_LIST);&lt;/P&gt;&lt;P&gt;print num_sectors;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the data Zcom where it has column field called : "STAT_YEAR" I am trying to extract part of the data where STAT_YEAR = '1993'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I see the following error in the log:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;285&amp;nbsp; use Zcom;&lt;/P&gt;&lt;P&gt;286&amp;nbsp; read all var {FMBCOM} into sector_list where (stat_year = &amp;amp;yr);&lt;/P&gt;&lt;P&gt;ERROR: Type mismatch in WHERE clause for variable stat_year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; statement : READ at line 286 column 1&lt;/P&gt;&lt;P&gt;287&amp;nbsp; num_sectors = nrow(SECTOR_LIST);&lt;/P&gt;&lt;P&gt;288&amp;nbsp; print num_sectors;&lt;/P&gt;&lt;P&gt;Could not display help because connection to the remote browser failed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Idea:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Jul 2012 14:39:16 GMT</pubDate>
    <dc:creator>goliPSU</dc:creator>
    <dc:date>2012-07-03T14:39:16Z</dc:date>
    <item>
      <title>Error in assiging a variable in IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Error-in-assiging-a-variable-in-IML/m-p/98219#M706</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;below is the part of my code:&lt;/P&gt;&lt;P&gt;proc iml&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let yr = '1993';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;nonMakeInd = {192}; /*Identify empty rows of the Make matrix*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use CxC_ind;&lt;/P&gt;&lt;P&gt;read all var {FMB_IO} into CxC;&lt;/P&gt;&lt;P&gt;num_com = nrow(CxC);&lt;/P&gt;&lt;P&gt;print num_com;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*-----------------------------------------------------------------------------*/&lt;/P&gt;&lt;P&gt;/*-----------------------------------------------------------------------------*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/*DEFINE, LOCATE matrix positions of sets and subsets */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use Zcom;&lt;/P&gt;&lt;P&gt;read all var {FMBCOM} into sector_list where (stat_year = &amp;amp;yr);&lt;/P&gt;&lt;P&gt;num_sectors = nrow(SECTOR_LIST);&lt;/P&gt;&lt;P&gt;print num_sectors;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the data Zcom where it has column field called : "STAT_YEAR" I am trying to extract part of the data where STAT_YEAR = '1993'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I see the following error in the log:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;285&amp;nbsp; use Zcom;&lt;/P&gt;&lt;P&gt;286&amp;nbsp; read all var {FMBCOM} into sector_list where (stat_year = &amp;amp;yr);&lt;/P&gt;&lt;P&gt;ERROR: Type mismatch in WHERE clause for variable stat_year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; statement : READ at line 286 column 1&lt;/P&gt;&lt;P&gt;287&amp;nbsp; num_sectors = nrow(SECTOR_LIST);&lt;/P&gt;&lt;P&gt;288&amp;nbsp; print num_sectors;&lt;/P&gt;&lt;P&gt;Could not display help because connection to the remote browser failed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any Idea:&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 14:39:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Error-in-assiging-a-variable-in-IML/m-p/98219#M706</guid>
      <dc:creator>goliPSU</dc:creator>
      <dc:date>2012-07-03T14:39:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error in assiging a variable in IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Error-in-assiging-a-variable-in-IML/m-p/98220#M707</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The SAS/IML User's guide is online, so you can view it whenever you have an internet connection.&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/onlinedoc/iml/index.html#iml93"&gt;http://support.sas.com/documentation/onlinedoc/iml/index.html#iml93&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The WHERE clause is discussed in several places, including here: &lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/imlug/64248/HTML/default/viewer.htm#imlug_worksasdatasets_sect013.htm"&gt;http://support.sas.com/documentation/cdl/en/imlug/64248/HTML/default/viewer.htm#imlug_worksasdatasets_sect013.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your error is that you defined &amp;amp;yr to be a character value when you wrote &lt;/P&gt;&lt;P&gt;%let yr = '1993';&lt;/P&gt;&lt;P&gt;If stat_yrear is a numerical variable, this is a "type mismatch" because you are trying to match a numerical value to a character string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use&lt;/P&gt;&lt;P&gt;%let yr = 1993;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 14:52:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Error-in-assiging-a-variable-in-IML/m-p/98220#M707</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2012-07-03T14:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: Error in assiging a variable in IML</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Error-in-assiging-a-variable-in-IML/m-p/98221#M708</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, it was very helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Jul 2012 15:26:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/Error-in-assiging-a-variable-in-IML/m-p/98221#M708</guid>
      <dc:creator>goliPSU</dc:creator>
      <dc:date>2012-07-03T15:26:37Z</dc:date>
    </item>
  </channel>
</rss>

