<?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: Column name looping and create dataset using the column name in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-data-into-subsets/m-p/454614#M114899</link>
    <description>&lt;P&gt;Note the expert recommendation - don't do this. It makes your life harder down the road.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're going to do it anyways, try the options here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Split_Data_into_Subsets" target="_blank"&gt;http://www.sascommunity.org/wiki/Split_Data_into_Subsets&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2015/01/26/how-to-split-one-data-set-into-many/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2015/01/26/how-to-split-one-data-set-into-many/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Apr 2018 02:24:48 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-04-17T02:24:48Z</dc:date>
    <item>
      <title>Create data into subsets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-data-into-subsets/m-p/454596#M114894</link>
      <description>&lt;P&gt;Dear experts, Need help on looping column names (varlist) and create a new table with unique name and id.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc contents data=patch.Windows_patch out=patch.contents noprint; run;&lt;BR /&gt;&lt;BR /&gt;proc sql ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; select name into :varlist separated by ' '&lt;BR /&gt;&amp;nbsp; from patch.contents where name like '%CHG%';&lt;BR /&gt;%let n=&amp;amp;obs;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;do i = 1 to dim(Patch) ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;create table Patch.Patch(i) as select unique a.Name, a.CI_ID, B.App, b.App_ID from Patch.Troux a, Patch.Win_servers b&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;where a.CI_ID=b.App_ID and b.Patch(i) is not null order by a.Name;&lt;/P&gt;
&lt;P&gt;end;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 02:23:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-data-into-subsets/m-p/454596#M114894</guid>
      <dc:creator>radha009</dc:creator>
      <dc:date>2018-04-17T02:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Array to loop column name variable wide to long</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-data-into-subsets/m-p/454600#M114895</link>
      <description>&lt;P&gt;Don't.&lt;/P&gt;
&lt;P&gt;Use PROC TRANSPOSE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&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;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 23:09:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-data-into-subsets/m-p/454600#M114895</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-16T23:09:44Z</dc:date>
    </item>
    <item>
      <title>Column name looping and create dataset using the column name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-data-into-subsets/m-p/454601#M114896</link>
      <description>&lt;P&gt;oops my subject got change on search.&lt;/P&gt;&lt;P&gt;Need help on looping column names (varlist) and create a new table with unique name and id.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc contents data=patch.Windows_patch out=patch.contents noprint; run;&lt;BR /&gt;&lt;BR /&gt;proc sql ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; select name into :varlist separated by ' '&lt;BR /&gt;&amp;nbsp; from patch.contents where name like '%CHG%';&lt;BR /&gt;%let n=&amp;amp;obs;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;do i = 1 to dim(Patch) ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;create table Patch.Patch(i) as select unique a.Name, a.CI_ID, B.App, b.App_ID from Patch.Troux a, Patch.Win_servers b&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;where a.CI_ID=b.App_ID and b.Patch(i) is not null order by a.Name;&lt;/P&gt;&lt;P&gt;end;&lt;BR /&gt;quit;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Apr 2018 23:22:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-data-into-subsets/m-p/454601#M114896</guid>
      <dc:creator>radha009</dc:creator>
      <dc:date>2018-04-16T23:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Column name looping and create dataset using the column name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-data-into-subsets/m-p/454612#M114898</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you trying to subset the data based on the list you&amp;nbsp; have in the macro variable. Try something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select distinct age into:Age_dist separated by ','
from sashelp.class;
quit;
options symbolgen mprint mlogic;
%PUT &amp;amp;Age_Dist;
%Macro Subset();
%DO i=1 %to %SYSFUNC(Countw("&amp;amp;Age_Dist"));
%LET var=%SCAN(%BQUOTE(&amp;amp;Age_Dist),&amp;amp;i,',');
proc sql;
create table DS_&amp;amp;Var as 
select distinct name,age
from sashelp.class
where age=&amp;amp;Var;
quit;
%End;
%MEND Subset;
%subset();&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 17 Apr 2018 01:30:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-data-into-subsets/m-p/454612#M114898</guid>
      <dc:creator>SuryaKiran</dc:creator>
      <dc:date>2018-04-17T01:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Column name looping and create dataset using the column name</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-data-into-subsets/m-p/454614#M114899</link>
      <description>&lt;P&gt;Note the expert recommendation - don't do this. It makes your life harder down the road.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're going to do it anyways, try the options here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Split_Data_into_Subsets" target="_blank"&gt;http://www.sascommunity.org/wiki/Split_Data_into_Subsets&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2015/01/26/how-to-split-one-data-set-into-many/" target="_blank"&gt;https://blogs.sas.com/content/sasdummy/2015/01/26/how-to-split-one-data-set-into-many/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 02:24:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-data-into-subsets/m-p/454614#M114899</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-04-17T02:24:48Z</dc:date>
    </item>
  </channel>
</rss>

