<?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: Applying combinations to a column in excel in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488569#M127365</link>
    <description>&lt;P&gt;Post have dataset as a datastep:&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;Post what you want out from this data.&amp;nbsp; Not going to guess any further.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Aug 2018 14:12:50 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-08-21T14:12:50Z</dc:date>
    <item>
      <title>Applying combinations to a column in excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488547#M127353</link>
      <description>&lt;P&gt;I have a excel file in which i have a column as policy no in this way-&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;polnr&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;786543,0&lt;SPAN&gt;786543&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;957432,00957432&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;0746352,746352&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;937526,000937526&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;X04578,0X04578&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to add a condition in my code which will make 4 combinations of each policy no such as with no zero,with 1 leading zero,with 2 leading zero and 3 leading zero.no matter what combinations it has i just want this 4 combinations.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i made a below code but it isnt working for these.just for the ref here it is&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;data ds2;&lt;BR /&gt;length pol $100;&lt;BR /&gt;set ds;&lt;BR /&gt;if (anydigit(pol)&amp;lt;1) then output;&lt;BR /&gt;else do;&lt;BR /&gt;do while(char(pol,1)='0');&lt;BR /&gt;pol=substrn(pol,2);&lt;BR /&gt;end;&lt;BR /&gt;output;&lt;BR /&gt;pol="0"||strip(pol);&lt;BR /&gt;output;&lt;BR /&gt;pol="0"||strip(pol);&lt;BR /&gt;output;&lt;BR /&gt;pol="0"||strip(pol);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;please help me.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Regards:)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 13:30:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488547#M127353</guid>
      <dc:creator>thelearner</dc:creator>
      <dc:date>2018-08-21T13:30:05Z</dc:date>
    </item>
    <item>
      <title>Re: Applying combinations to a column in excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488560#M127361</link>
      <description>&lt;P&gt;One Way..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input polnr $;
datalines;
786543
0786543
957432
00957432
0746352
746352
937526
000937526
X04578
0X04578
;

data want(drop=i);
   set have;
   pol =polnr;
   output;
   do i=1 to 3;
      pol =cats('0', pol );
      output;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Aug 2018 13:57:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488560#M127361</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-08-21T13:57:10Z</dc:date>
    </item>
    <item>
      <title>Re: Applying combinations to a column in excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488561#M127362</link>
      <description>&lt;P&gt;Please post test data in the form of a datastep:&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;And what you want to see out at the end.&amp;nbsp; Its hard to guess what you have /want?&amp;nbsp; I.e. you could have/want:&lt;/P&gt;
&lt;PRE&gt;data have;
  length polnr $20;
  input polnr $;
datalines;
786543
0786543
;
run;

data want;
  set have;
  array res{4} $20;
  do i=1 to 4;
    res{i}=cats(repeat("0",i),polnr);
  end;
run;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Aug 2018 14:00:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488561#M127362</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-21T14:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Applying combinations to a column in excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488563#M127363</link>
      <description>&lt;P&gt;i have 2 different combination in same column separated by ',' in one single line in excel.and from those 2 combination i want to make 4 different combination.&lt;/P&gt;&lt;P&gt;no matter how many combinations i have i just want to make it 4&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 14:04:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488563#M127363</guid>
      <dc:creator>thelearner</dc:creator>
      <dc:date>2018-08-21T14:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: Applying combinations to a column in excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488568#M127364</link>
      <description>&lt;P&gt;Just to be sure then.. So if you have one record with two combinations with 0 and 2 leading zeros respectively, then you want to add two extra combinations with 1 and 3&amp;nbsp;&lt;SPAN&gt;leading zeros respectively, correct?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 14:10:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488568#M127364</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-08-21T14:10:04Z</dc:date>
    </item>
    <item>
      <title>Re: Applying combinations to a column in excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488569#M127365</link>
      <description>&lt;P&gt;Post have dataset as a datastep:&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;Post what you want out from this data.&amp;nbsp; Not going to guess any further.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 14:12:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488569#M127365</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-08-21T14:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Applying combinations to a column in excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488571#M127367</link>
      <description>&lt;P&gt;exactly.but in the same line itself.which should be separated by ','.as its an excel file.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 14:13:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488571#M127367</guid>
      <dc:creator>thelearner</dc:creator>
      <dc:date>2018-08-21T14:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Applying combinations to a column in excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488576#M127369</link>
      <description>&lt;P&gt;Can I assume that your data is representative? Or can you also have 0 combinations? Or 1? Or all 4?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 14:22:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488576#M127369</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2018-08-21T14:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Applying combinations to a column in excel</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488605#M127383</link>
      <description>&lt;P&gt;yes it my have any combination.may be 1 or may be 2 or 3 or 4 as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Aug 2018 14:55:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Applying-combinations-to-a-column-in-excel/m-p/488605#M127383</guid>
      <dc:creator>thelearner</dc:creator>
      <dc:date>2018-08-21T14:55:16Z</dc:date>
    </item>
  </channel>
</rss>

