<?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: unstack the count in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/unstack-the-count/m-p/910798#M359150</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table spliSQL as
select * from split
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":winking_face_with_tongue:"&gt;😜&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;... and seriously, sql is not a tool for such job (&lt;A title="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068/show-comments/false" href="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068/show-comments/false" target="_self"&gt;Maxim 14&lt;/A&gt;), data step is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jan 2024 07:08:39 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2024-01-08T07:08:39Z</dc:date>
    <item>
      <title>unstack the count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unstack-the-count/m-p/910795#M359148</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ds;
input item_name: $ 15. total_count;
datalines;
Water_Bottle  2
Tent   1
Apple 4
;
run;


data split;
set ds;
do split=1 to total_count;
output;
end; drop total_count;
proc print ;
run;

Q)1. How to get split item count using proc sql&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Jan 2024 06:47:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unstack-the-count/m-p/910795#M359148</guid>
      <dc:creator>pavank</dc:creator>
      <dc:date>2024-01-08T06:47:07Z</dc:date>
    </item>
    <item>
      <title>Re: unstack the count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unstack-the-count/m-p/910798#M359150</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table spliSQL as
select * from split
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":winking_face_with_tongue:"&gt;😜&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;... and seriously, sql is not a tool for such job (&lt;A title="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068/show-comments/false" href="https://communities.sas.com/t5/SAS-Communities-Library/Maxims-of-Maximally-Efficient-SAS-Programmers/ta-p/352068/show-comments/false" target="_self"&gt;Maxim 14&lt;/A&gt;), data step is.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 07:08:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unstack-the-count/m-p/910798#M359150</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2024-01-08T07:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: unstack the count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unstack-the-count/m-p/910817#M359161</link>
      <description>&lt;P&gt;Not possible with standard SQL as implemented in SAS.&lt;/P&gt;
&lt;P&gt;Most databases have extensions like T-SQL or PL-SQL that allow for loops. In SAS you've got the data step for this.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 09:25:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unstack-the-count/m-p/910817#M359161</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-01-08T09:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: unstack the count</title>
      <link>https://communities.sas.com/t5/SAS-Programming/unstack-the-count/m-p/910820#M359163</link>
      <description>&lt;P&gt;Simple (and correct) answer: Don't.&lt;/P&gt;
&lt;P&gt;SQL is not the tool for such a task, the DATA step is. Maxim 14 (as already mentioned).&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 09:31:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/unstack-the-count/m-p/910820#M359163</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-01-08T09:31:14Z</dc:date>
    </item>
  </channel>
</rss>

