<?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: mapping different values on basis of row and column in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754395#M237888</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Number of rows doesn't matter to the solution. &lt;BR /&gt;For the increase in variables you can list just the first and last variables, you don't need to list all. &lt;BR /&gt;This would use all variables between A and C. &lt;BR /&gt;&lt;BR /&gt;array v (*) A -- C;&lt;BR /&gt;&lt;BR /&gt;Change &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; code to : dim(v) from dim(n). &lt;BR /&gt;&lt;BR /&gt;Small typo. &lt;BR /&gt;The links in my first answer provide more details on these methods and they both scale. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Good catch. I tested the code with Array N and then started changing it to avoid the "name is the same as function" messages and missed the change on the Do statement.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Jul 2021 16:59:04 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-07-15T16:59:04Z</dc:date>
    <item>
      <title>calling a value using row and column.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754367#M237871</link>
      <description>&lt;P&gt;Hi, I have table 'have' and first 2 columns of table 'want'.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get the corresponding values with respect to each var1 and var2. Please help if someone has the solution.&lt;/P&gt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&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 15 Jul 2021 15:33:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754367#M237871</guid>
      <dc:creator>Decay2020</dc:creator>
      <dc:date>2021-07-15T15:33:59Z</dc:date>
    </item>
    <item>
      <title>mapping different values on basis of row and column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754368#M237873</link>
      <description>&lt;P&gt;Hi, I have table 'have' and first 2 columns of table 'want'.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to get the corresponding values with respect to each var1 and var2. Please help if someone has the solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table have:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt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&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;9&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 15 Jul 2021 15:39:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754368#M237873</guid>
      <dc:creator>Decay2020</dc:creator>
      <dc:date>2021-07-15T15:39:41Z</dc:date>
    </item>
    <item>
      <title>Re: mapping different values on basis of row and column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754373#M237874</link>
      <description>&lt;P&gt;Duplicate posts combined.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You "have" description is incomplete as a SAS data set must have a name for every variable, i.e. "column".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is one way:&lt;/P&gt;
&lt;PRE&gt;data have;
input row $ A	B	C;
datalines;
A	1	2	3
B	4	5	6
C	7	8	9
;

data want;
   set have;
   array v (*) A B C;
   do i=1 to dim(&lt;STRIKE&gt;n&lt;/STRIKE&gt; v);
      var1= row;
      var2 = vname(v[i]);
      value = v[i];
      output;
   end;
   keep var1 var2 value;
run;&lt;/PRE&gt;
&lt;P&gt;For this approach to work all of the variables A B C, or whatever the real ones may be must be of the same type, either all numeric or all character If they are mixed then you have a more complicated problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have any other variables involved you may need to show how you expect their values to be handled as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 16:57:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754373#M237874</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-07-15T16:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: calling a value using row and column.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754374#M237872</link>
      <description>&lt;P&gt;TRANSPOSE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Transposing data tutorials:&lt;BR /&gt;Wide to Long:&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-wide-to-long-using-proc-transpose/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-wide-to-long-using-proc-transpose/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://stats.idre.ucla.edu/sas/modules/reshaping-data-wide-to-long-using-a-data-step/" target="_blank"&gt;https://stats.idre.ucla.edu/sas/modules/reshaping-data-wide-to-long-using-a-data-step/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc transpose data=have out=want;
by ID;
var A B C;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/389613"&gt;@Decay2020&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi, I have table 'have' and first 2 columns of table 'want'.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to get the corresponding values with respect to each var1 and var2. Please help if someone has the solution.&lt;/P&gt;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lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;A&lt;/TD&gt;
&lt;TD&gt;4&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;A&lt;/TD&gt;
&lt;TD&gt;7&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;9&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 15:49:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754374#M237872</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-15T15:49:07Z</dc:date>
    </item>
    <item>
      <title>Re: calling a value using row and column.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754377#M237875</link>
      <description>FYI more common terms for this task are transpose or pivot. If you search with those terms in any language you'll find an answer.</description>
      <pubDate>Thu, 15 Jul 2021 15:54:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754377#M237875</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-15T15:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: calling a value using row and column.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754383#M237877</link>
      <description>&lt;P&gt;Yes, you are partially right. As I tried to give a simple example to get an idea about the solution, but the reality is completely different. Just imagine there are hundreds of columns instead of just 3 (namely A, B , C)&amp;nbsp; in table 'Have' and we don't know if we have all the combination of those in var1 and var2 in the table 'want'. Now we are interested in getting only the values with respect to those combinations that are present in Table 'want'. Let me know if I was able to explain the things further.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 16:34:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754383#M237877</guid>
      <dc:creator>Decay2020</dc:creator>
      <dc:date>2021-07-15T16:34:28Z</dc:date>
    </item>
    <item>
      <title>Re: mapping different values on basis of row and column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754384#M237878</link>
      <description>I am getting this error:&lt;BR /&gt;ERROR: The DIM, LBOUND, and HBOUND functions require an array name for the first argument.&lt;BR /&gt;&lt;BR /&gt;Also, we have var1 and var2 which are the combinations from the table 'Have'. We are more interested in getting the 'values' with respect to var1 and var2 combination.&lt;BR /&gt;And, a correction in the problem, just think if there are hundreds of columns and rows, not just 3 (namely =A,B and C).</description>
      <pubDate>Thu, 15 Jul 2021 16:41:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754384#M237878</guid>
      <dc:creator>Decay2020</dc:creator>
      <dc:date>2021-07-15T16:41:20Z</dc:date>
    </item>
    <item>
      <title>Re: mapping different values on basis of row and column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754386#M237880</link>
      <description>Number of rows doesn't matter to the solution. &lt;BR /&gt;For the increase in variables you can list just the first and last variables, you don't need to list all. &lt;BR /&gt;This would use all variables between A and C. &lt;BR /&gt;&lt;BR /&gt;array v (*) A -- C;&lt;BR /&gt;&lt;BR /&gt;Change &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; code to : dim(v) from dim(n). &lt;BR /&gt;&lt;BR /&gt;Small typo. &lt;BR /&gt;The links in my first answer provide more details on these methods and they both scale. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Jul 2021 16:44:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754386#M237880</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-15T16:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: calling a value using row and column.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754387#M237881</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/389613"&gt;@Decay2020&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes, you are partially right. As I tried to give a simple example to get an idea about the solution, but the reality is completely different. Just imagine there are hundreds of columns instead of just 3 (namely A, B , C)&amp;nbsp; in table 'Have' and we don't know if we have all the combination of those in var1 and var2 in the table 'want'. Now we are interested in getting only the values with respect to those combinations that are present in Table 'want'. Let me know if I was able to explain the things further.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;"All possible combinations" is a somewhat different kettle of fish. And hundreds of columns (really time to use variables if the data is in SAS) translates into extremely large numbers of combinations quickly. If you have 100 variables and each has only 3 values you are looking for 3**100 combinations, or about 5.1537752E47 combinations. That is 5 followed by 47 more digits. 200 variables pushes that to&amp;nbsp; 2.65E95 combinations. Remember this example is only using 3 values per variable. If you have stuff like account numbers, dates or similar that have more possible values then your combinations goes up even quicker.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Which "var1" and "var2" are referring to? After a data set has been transposed as shown? Or specific existing variables in the data?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 16:45:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754387#M237881</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-07-15T16:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: calling a value using row and column.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754389#M237882</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/389613"&gt;@Decay2020&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Yes, you are partially right. As I tried to give a simple example to get an idea about the solution, but the reality is completely different. Just imagine there are hundreds of columns instead of just 3 (namely A, B , C)&amp;nbsp; in table 'Have' and we don't know if we have all the combination of those in var1 and var2 in the table 'want'. Now we are interested in getting only the values with respect to those combinations that are present in Table 'want'. Let me know if I was able to explain the things further.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Doesn't matter, it doesn't change my solution.&lt;/P&gt;
&lt;P&gt;The number of rows are irrelevant and the number of columns can be easily referenced using shortcut lists.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is a reference that illustrates how to refer to variables and datasets in a short cut list:&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/389613"&gt;@Decay2020&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;Now we are interested in getting only the values with respect to those combinations that are present in Table 'want'. Let me know if I was able to explain the things further.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;BR /&gt;Then why work with the whole data set at all? Generate your list from your WANT data set and merge it in. Unless there's something else you're not explaining this looks like a standard look up problem. Another approach that make more sense to the way you seem to be thinking is to load it into a two dimensional temporary array. If you provide a full example of input and expected output I'll take a stab at coding that. Please post your data as a data step following the instructions below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Make sure to include both your exact input and the matching expected output. If you cannot provide real data, make fake data that's representative of your problem.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instructions on how to provide sample data is here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 16:51:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754389#M237882</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-15T16:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: mapping different values on basis of row and column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754395#M237888</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Number of rows doesn't matter to the solution. &lt;BR /&gt;For the increase in variables you can list just the first and last variables, you don't need to list all. &lt;BR /&gt;This would use all variables between A and C. &lt;BR /&gt;&lt;BR /&gt;array v (*) A -- C;&lt;BR /&gt;&lt;BR /&gt;Change &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; code to : dim(v) from dim(n). &lt;BR /&gt;&lt;BR /&gt;Small typo. &lt;BR /&gt;The links in my first answer provide more details on these methods and they both scale. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Good catch. I tested the code with Array N and then started changing it to avoid the "name is the same as function" messages and missed the change on the Do statement.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 16:59:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754395#M237888</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-07-15T16:59:04Z</dc:date>
    </item>
    <item>
      <title>Re: calling a value using row and column.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754398#M237890</link>
      <description>&lt;P&gt;Thank you for your quick turnaround.&lt;/P&gt;&lt;P&gt;That is the reason we don't have that much combinations. we are trying get the value for only the subset. Also, i just mould the problem which makes much more sense.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is what we have. we need to populate column3 in table 2.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Person A&lt;/TD&gt;&lt;TD&gt;Person B&lt;/TD&gt;&lt;TD&gt;Person C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Person A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Person B&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;TD&gt;7&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Person C&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;TD&gt;12&lt;/TD&gt;&lt;TD&gt;13&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;year 1&lt;/TD&gt;&lt;TD&gt;year 2&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Person A&lt;/TD&gt;&lt;TD&gt;Person B&lt;/TD&gt;&lt;TD&gt;?&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Person B&lt;/TD&gt;&lt;TD&gt;Person C&lt;/TD&gt;&lt;TD&gt;?&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Person C&lt;/TD&gt;&lt;TD&gt;Person B&lt;/TD&gt;&lt;TD&gt;?&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Person B&lt;/TD&gt;&lt;TD&gt;Person C&lt;/TD&gt;&lt;TD&gt;?&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Person C&lt;/TD&gt;&lt;TD&gt;Person A&lt;/TD&gt;&lt;TD&gt;?&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 15 Jul 2021 17:02:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754398#M237890</guid>
      <dc:creator>Decay2020</dc:creator>
      <dc:date>2021-07-15T17:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: mapping different values on basis of row and column</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754400#M237892</link>
      <description>I almost typed that out as well &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;</description>
      <pubDate>Thu, 15 Jul 2021 17:03:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754400#M237892</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-15T17:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: calling a value using row and column.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754401#M237893</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/389613"&gt;@Decay2020&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for your quick turnaround.&lt;/P&gt;
&lt;P&gt;That is the reason we don't have that much combinations. we are trying get the value for only the subset. Also, i just mould the problem which makes much more sense.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what we have. we need to populate column3 in table 2.&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;Person A&lt;/TD&gt;
&lt;TD&gt;Person B&lt;/TD&gt;
&lt;TD&gt;Person C&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Person A&lt;/TD&gt;
&lt;TD&gt;1&lt;/TD&gt;
&lt;TD&gt;2&lt;/TD&gt;
&lt;TD&gt;3&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Person B&lt;/TD&gt;
&lt;TD&gt;6&lt;/TD&gt;
&lt;TD&gt;7&lt;/TD&gt;
&lt;TD&gt;8&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Person C&lt;/TD&gt;
&lt;TD&gt;11&lt;/TD&gt;
&lt;TD&gt;12&lt;/TD&gt;
&lt;TD&gt;13&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;year 1&lt;/TD&gt;
&lt;TD&gt;year 2&lt;/TD&gt;
&lt;TD&gt;Value&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Person A&lt;/TD&gt;
&lt;TD&gt;Person B&lt;/TD&gt;
&lt;TD&gt;?&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Person B&lt;/TD&gt;
&lt;TD&gt;Person C&lt;/TD&gt;
&lt;TD&gt;?&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Person C&lt;/TD&gt;
&lt;TD&gt;Person B&lt;/TD&gt;
&lt;TD&gt;?&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Person B&lt;/TD&gt;
&lt;TD&gt;Person C&lt;/TD&gt;
&lt;TD&gt;?&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Person C&lt;/TD&gt;
&lt;TD&gt;Person A&lt;/TD&gt;
&lt;TD&gt;?&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Now you have introduced the concept of time by referencing Year without any source in the "start" data. Which would bring up where does year come from, how many "years" are there and what actual data sets are involved.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Jul 2021 17:07:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754401#M237893</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-07-15T17:07:53Z</dc:date>
    </item>
    <item>
      <title>Re: calling a value using row and column.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754406#M237898</link>
      <description>1. Use &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt; or my solution to transpose your data.&lt;BR /&gt;2. Use a left join to merge the smaller table with your big table. &lt;BR /&gt;&lt;BR /&gt;If you'd like a full overview of all the lookup methods and the different advantages read this paper please:&lt;BR /&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings/pdfs/sgf2008/095-2008.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings/pdfs/sgf2008/095-2008.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 15 Jul 2021 17:18:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754406#M237898</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-07-15T17:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: calling a value using row and column.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754407#M237899</link>
      <description>Please treat year1 as the previous year and year 2 as the present for your reference. But, concept of time is not applicable here. you can treat year1 and year2 as any character variable.&lt;BR /&gt;Again, we are interested in calling the value where the combination is. like for example personA and personB should yield a value of 2.&lt;BR /&gt;I will try to work on making the best sample of my problem too. Meanwhile thanks for your help.</description>
      <pubDate>Thu, 15 Jul 2021 17:18:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754407#M237899</guid>
      <dc:creator>Decay2020</dc:creator>
      <dc:date>2021-07-15T17:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: calling a value using row and column.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754410#M237902</link>
      <description>Thank you both for helping out. i have got the idea. i will definitely use the solution and try to mould it to get to the desired output.</description>
      <pubDate>Thu, 15 Jul 2021 17:24:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/calling-a-value-using-row-and-column/m-p/754410#M237902</guid>
      <dc:creator>Decay2020</dc:creator>
      <dc:date>2021-07-15T17:24:12Z</dc:date>
    </item>
  </channel>
</rss>

