<?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 Re: Get value of a specific &amp;quot;cell&amp;quot; of a dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Get-value-of-a-specific-quot-cell-quot-of-a-dataset/m-p/671398#M201616</link>
    <description>&lt;P&gt;To reference a particular value in a sas dataset column can do&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The conditional check itself will return a boolean value of 0 or 1. If using in a function you can use it as 70*(age=70); when age=70 the multiplication returns a 70 it will return 0 otherwise. Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if &amp;lt;colname&amp;gt; = value;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jul 2020 14:29:28 GMT</pubDate>
    <dc:creator>smantha</dc:creator>
    <dc:date>2020-07-22T14:29:28Z</dc:date>
    <item>
      <title>Get value of a specific "cell" of a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-value-of-a-specific-quot-cell-quot-of-a-dataset/m-p/671371#M201601</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I have an imported dataset A and I&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;need to get a specific cell value. Is there a way, like in other languages, to get the value by its coordinates (ex : A[4;5]) ?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 12:53:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-value-of-a-specific-quot-cell-quot-of-a-dataset/m-p/671371#M201601</guid>
      <dc:creator>Gluttony</dc:creator>
      <dc:date>2020-07-22T12:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Get value of a specific "cell" of a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-value-of-a-specific-quot-cell-quot-of-a-dataset/m-p/671372#M201602</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/316156"&gt;@Gluttony&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I have an imported dataset A and I&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;need to get a specific cell value. Is there a way, like in other languages, to get the value by its coordinates (ex : A[4;5]) ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Why? Why would you want to do such a thing? How are you going to use the value once you have it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want the value of a specific variable from a specific observation there are many ways.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example if the fifth column is named VAR5 then you could get the value for it from the fourth observation using this data step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have (keep=VAR5 firstobs=4 obs=4);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jul 2020 12:58:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-value-of-a-specific-quot-cell-quot-of-a-dataset/m-p/671372#M201602</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-07-22T12:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Get value of a specific "cell" of a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-value-of-a-specific-quot-cell-quot-of-a-dataset/m-p/671374#M201604</link>
      <description>&lt;P&gt;Thank you for your answer,&lt;/P&gt;&lt;P&gt;I'm creating a function with&amp;nbsp;&lt;STRONG&gt;proc fcmp&lt;/STRONG&gt;&amp;nbsp;to apply it on &lt;STRONG&gt;B&amp;nbsp;&lt;/STRONG&gt;(let's say ages : 70, 71, 72, 73...), and in this function, I need to get the value associated to the age (70 for ex.) in table &lt;STRONG&gt;A &lt;/STRONG&gt;and then use it with a multiplication&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 13:05:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-value-of-a-specific-quot-cell-quot-of-a-dataset/m-p/671374#M201604</guid>
      <dc:creator>Gluttony</dc:creator>
      <dc:date>2020-07-22T13:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get value of a specific "cell" of a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-value-of-a-specific-quot-cell-quot-of-a-dataset/m-p/671398#M201616</link>
      <description>&lt;P&gt;To reference a particular value in a sas dataset column can do&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The conditional check itself will return a boolean value of 0 or 1. If using in a function you can use it as 70*(age=70); when age=70 the multiplication returns a 70 it will return 0 otherwise. Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if &amp;lt;colname&amp;gt; = value;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 14:29:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-value-of-a-specific-quot-cell-quot-of-a-dataset/m-p/671398#M201616</guid>
      <dc:creator>smantha</dc:creator>
      <dc:date>2020-07-22T14:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Get value of a specific "cell" of a dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Get-value-of-a-specific-quot-cell-quot-of-a-dataset/m-p/671551#M201679</link>
      <description>&lt;P&gt;Is this the one where you wanted to call a macro and run some other code to get a value the function can return?&lt;/P&gt;
&lt;P&gt;So it looks like you want to pass in three values to your macro.&amp;nbsp; The NAME of the variable to sum and the upper and lower limits for the value of ID variable to include in the sum.&lt;/P&gt;
&lt;P&gt;So an SQL query like this could be used to get the sum into the macro variable RESULT.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select sum(&amp;amp;varname) format=best32. into :result  trimmed
from MYTABLE
where ID between &amp;amp;LOWER and &amp;amp;UPPER
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Jul 2020 19:05:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Get-value-of-a-specific-quot-cell-quot-of-a-dataset/m-p/671551#M201679</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2020-07-22T19:05:51Z</dc:date>
    </item>
  </channel>
</rss>

