<?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 Put a specifik value in a cell to differents row and coulumns in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Put-a-specifik-value-in-a-cell-to-differents-row-and-coulumns/m-p/808507#M318821</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have a data set who looks like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; x&amp;nbsp; y&amp;nbsp; z w q&lt;/P&gt;&lt;P&gt;A 1&amp;nbsp; &amp;nbsp;2&amp;nbsp; 3&amp;nbsp; 4 5&amp;nbsp;&lt;BR /&gt;B&amp;nbsp; 6 7&amp;nbsp; 8&amp;nbsp; 9 10&lt;BR /&gt;C&amp;nbsp; 11 12&amp;nbsp; 13&amp;nbsp; 14&lt;BR /&gt;D 15&amp;nbsp; &amp;nbsp;16&amp;nbsp; &amp;nbsp;17 18&lt;/P&gt;&lt;P&gt;E 19&amp;nbsp; &amp;nbsp;20 21 22 23&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I want to have like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; x&amp;nbsp; y&amp;nbsp; z w q (col) (row)&amp;nbsp;&lt;/P&gt;&lt;P&gt;A 1&amp;nbsp; &amp;nbsp;2&amp;nbsp; 3&amp;nbsp; 4 5&amp;nbsp; 101 202&lt;BR /&gt;B&amp;nbsp; 6 7&amp;nbsp; 8&amp;nbsp; 9 10&amp;nbsp; &amp;nbsp;... ...&lt;BR /&gt;C&amp;nbsp; 11 12&amp;nbsp; 13&amp;nbsp; 14 -- --&amp;nbsp;&lt;BR /&gt;D 15&amp;nbsp; &amp;nbsp;16&amp;nbsp; &amp;nbsp;17 18... --&amp;nbsp;&lt;/P&gt;&lt;P&gt;E 19&amp;nbsp; &amp;nbsp;20 21 22 23 ... .....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so when A = x (value 1) we have col = 101 and row = 202&lt;/P&gt;&lt;P&gt;and when A = y (value: 2) we have&amp;nbsp; col = ... and row ...&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;beacuse all of the values (1, 2, 3 ... 23) is a statistical values that I have calculated earlier in the code. (Sum, number of events, etc..) so and all of them is made by a proc sql and grouped by 1. i tried to do like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table varden as&lt;BR /&gt;select distinct&lt;BR /&gt;&amp;nbsp;category,&lt;BR /&gt;count(...) as NumberOfEvents,&lt;BR /&gt;sum(....) as GrossLossAmount,&lt;BR /&gt;max(.....) as MaxRapportsumma, /* Maximum single loss */&lt;BR /&gt;(case&lt;BR /&gt;when aaa= 0 then 0&lt;BR /&gt;else count(LossAdjustments)&lt;BR /&gt;end) as NumberOfEvents&lt;BR /&gt;from blah&lt;BR /&gt;group by 1&lt;BR /&gt;;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table colrow&lt;BR /&gt;(col num(4),&lt;BR /&gt;row num(4),&lt;BR /&gt;id num(4)&lt;BR /&gt;)&lt;BR /&gt;;&lt;BR /&gt;insert into colrow (col, row, id)&lt;BR /&gt;values (0010, 0110, 0000)&lt;BR /&gt;........&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then I don't know join them togheter? and then do something like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table ____matrix as&lt;BR /&gt;select *,&lt;BR /&gt;(case&lt;BR /&gt;when 'A'='x' then col='0010' and row='0110'&lt;BR /&gt;when ....&lt;BR /&gt;uptil [64 times.}&lt;BR /&gt;else .&lt;BR /&gt;end)&lt;BR /&gt;from final&lt;BR /&gt;;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but no.. I want to export this later to an xlm file&lt;/P&gt;</description>
    <pubDate>Tue, 19 Apr 2022 09:53:52 GMT</pubDate>
    <dc:creator>melhaf</dc:creator>
    <dc:date>2022-04-19T09:53:52Z</dc:date>
    <item>
      <title>Put a specifik value in a cell to differents row and coulumns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Put-a-specifik-value-in-a-cell-to-differents-row-and-coulumns/m-p/808507#M318821</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have a data set who looks like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; x&amp;nbsp; y&amp;nbsp; z w q&lt;/P&gt;&lt;P&gt;A 1&amp;nbsp; &amp;nbsp;2&amp;nbsp; 3&amp;nbsp; 4 5&amp;nbsp;&lt;BR /&gt;B&amp;nbsp; 6 7&amp;nbsp; 8&amp;nbsp; 9 10&lt;BR /&gt;C&amp;nbsp; 11 12&amp;nbsp; 13&amp;nbsp; 14&lt;BR /&gt;D 15&amp;nbsp; &amp;nbsp;16&amp;nbsp; &amp;nbsp;17 18&lt;/P&gt;&lt;P&gt;E 19&amp;nbsp; &amp;nbsp;20 21 22 23&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I want to have like this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; x&amp;nbsp; y&amp;nbsp; z w q (col) (row)&amp;nbsp;&lt;/P&gt;&lt;P&gt;A 1&amp;nbsp; &amp;nbsp;2&amp;nbsp; 3&amp;nbsp; 4 5&amp;nbsp; 101 202&lt;BR /&gt;B&amp;nbsp; 6 7&amp;nbsp; 8&amp;nbsp; 9 10&amp;nbsp; &amp;nbsp;... ...&lt;BR /&gt;C&amp;nbsp; 11 12&amp;nbsp; 13&amp;nbsp; 14 -- --&amp;nbsp;&lt;BR /&gt;D 15&amp;nbsp; &amp;nbsp;16&amp;nbsp; &amp;nbsp;17 18... --&amp;nbsp;&lt;/P&gt;&lt;P&gt;E 19&amp;nbsp; &amp;nbsp;20 21 22 23 ... .....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so when A = x (value 1) we have col = 101 and row = 202&lt;/P&gt;&lt;P&gt;and when A = y (value: 2) we have&amp;nbsp; col = ... and row ...&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;beacuse all of the values (1, 2, 3 ... 23) is a statistical values that I have calculated earlier in the code. (Sum, number of events, etc..) so and all of them is made by a proc sql and grouped by 1. i tried to do like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table varden as&lt;BR /&gt;select distinct&lt;BR /&gt;&amp;nbsp;category,&lt;BR /&gt;count(...) as NumberOfEvents,&lt;BR /&gt;sum(....) as GrossLossAmount,&lt;BR /&gt;max(.....) as MaxRapportsumma, /* Maximum single loss */&lt;BR /&gt;(case&lt;BR /&gt;when aaa= 0 then 0&lt;BR /&gt;else count(LossAdjustments)&lt;BR /&gt;end) as NumberOfEvents&lt;BR /&gt;from blah&lt;BR /&gt;group by 1&lt;BR /&gt;;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table colrow&lt;BR /&gt;(col num(4),&lt;BR /&gt;row num(4),&lt;BR /&gt;id num(4)&lt;BR /&gt;)&lt;BR /&gt;;&lt;BR /&gt;insert into colrow (col, row, id)&lt;BR /&gt;values (0010, 0110, 0000)&lt;BR /&gt;........&lt;/P&gt;&lt;P&gt;.....&lt;/P&gt;&lt;P&gt;;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and then I don't know join them togheter? and then do something like&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table ____matrix as&lt;BR /&gt;select *,&lt;BR /&gt;(case&lt;BR /&gt;when 'A'='x' then col='0010' and row='0110'&lt;BR /&gt;when ....&lt;BR /&gt;uptil [64 times.}&lt;BR /&gt;else .&lt;BR /&gt;end)&lt;BR /&gt;from final&lt;BR /&gt;;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but no.. I want to export this later to an xlm file&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 09:53:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Put-a-specifik-value-in-a-cell-to-differents-row-and-coulumns/m-p/808507#M318821</guid>
      <dc:creator>melhaf</dc:creator>
      <dc:date>2022-04-19T09:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: Put a specifik value in a cell to differents row and coulumns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Put-a-specifik-value-in-a-cell-to-differents-row-and-coulumns/m-p/808512#M318822</link>
      <description>&lt;P&gt;Please post data in usable form, a dataset like&lt;/P&gt;
&lt;PRE&gt;   x  y  z  w  q
A  1  2  3  4  5 
B  6  7  8  9 10
C 11 12 13 14
D 15 16 17 18
E 19 20 21 22 23&lt;/PRE&gt;
&lt;P&gt;can't exist, because every variable / column needs a name.&lt;/P&gt;
&lt;P&gt;Where do the numbers 101 and 202 come from?&lt;/P&gt;
&lt;P&gt;Please show the complete result you expect and explain the logic to be applied.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 10:28:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Put-a-specifik-value-in-a-cell-to-differents-row-and-coulumns/m-p/808512#M318822</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-04-19T10:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: Put a specifik value in a cell to differents row and coulumns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Put-a-specifik-value-in-a-cell-to-differents-row-and-coulumns/m-p/808518#M318825</link>
      <description>&lt;P&gt;&amp;nbsp;I thought I could use a hypotetic data set. But let's say I have this then&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="media_f01_f01ed0cc-2e8d-4122-9c7f-dd2e1f5f16f8_phpY66fO7.png" style="width: 614px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70559i06C260BA58028085/image-size/large?v=v2&amp;amp;px=999" role="button" title="media_f01_f01ed0cc-2e8d-4122-9c7f-dd2e1f5f16f8_phpY66fO7.png" alt="media_f01_f01ed0cc-2e8d-4122-9c7f-dd2e1f5f16f8_phpY66fO7.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And i want all of this be printed out in a xls file later.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;But It HAS To be in a specifik order. In a coordinat system. Like; A suv in Asia has&amp;nbsp; to be in col = 101 and row= 202&amp;nbsp; so I want to add two columns in this cars dataset. "col" and "row"&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dsadsadsadsa.jpg" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70560i597E9F4CC770B762/image-size/large?v=v2&amp;amp;px=999" role="button" title="dsadsadsadsa.jpg" alt="dsadsadsadsa.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but how can I call a "cell" in this dataset and give them a col and row namE?&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 10:44:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Put-a-specifik-value-in-a-cell-to-differents-row-and-coulumns/m-p/808518#M318825</guid>
      <dc:creator>melhaf</dc:creator>
      <dc:date>2022-04-19T10:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Put a specifik value in a cell to differents row and coulumns</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Put-a-specifik-value-in-a-cell-to-differents-row-and-coulumns/m-p/808522#M318826</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/423316"&gt;@melhaf&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;but how can I call a "cell" in this dataset and give them a col and row namE?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Sorry, but this is not the way sas datasets are used. Dataset are like tables in a database, not like sheets in excel.&lt;/P&gt;
&lt;P&gt;You should really use data steps to post the data you have and what you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Apr 2022 11:21:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Put-a-specifik-value-in-a-cell-to-differents-row-and-coulumns/m-p/808522#M318826</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2022-04-19T11:21:43Z</dc:date>
    </item>
  </channel>
</rss>

