<?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: Creating different datasets by appending small once limit to 10 Alert_id cannot be over flow. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-different-datasets-by-appending-small-once-limit-to-10/m-p/551431#M153213</link>
    <description>It is creating want single dataset which contains 20 orbs from alert, what&lt;BR /&gt;is I required is a2’s 8 observations in 1 dataset and reaming a3 and a4 in&lt;BR /&gt;one a5 in 1 dataset each dataset should not be more than 10 obs and alertid&lt;BR /&gt;should not fall in another dataset, please help me . Thank you for your&lt;BR /&gt;reply</description>
    <pubDate>Tue, 16 Apr 2019 15:58:19 GMT</pubDate>
    <dc:creator>basani</dc:creator>
    <dc:date>2019-04-16T15:58:19Z</dc:date>
    <item>
      <title>Creating different datasets by appending small once limit to 10 Alert_id cannot be over flow.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-different-datasets-by-appending-small-once-limit-to-10/m-p/551141#M153199</link>
      <description>&lt;P&gt;I have created code till end which create the dataset two if more than 10 observations for row, if not then will create single dataset, my question is how to find and combine datasets which are small as 1 limiting to 10 rows.&lt;/P&gt;&lt;PRE&gt;&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data alert;&lt;BR /&gt;input alert_id $2. message;&lt;BR /&gt;datalines;&lt;BR /&gt;A1 1&lt;BR /&gt;A1 1&lt;BR /&gt;A1 1&lt;BR /&gt;A1 1&lt;BR /&gt;A1 1&lt;BR /&gt;A1 1&lt;BR /&gt;A1 1&lt;BR /&gt;A1 1&lt;BR /&gt;A1 1&lt;BR /&gt;A1 1&lt;BR /&gt;A1 1&lt;BR /&gt;A1 1&lt;BR /&gt;A1 1&lt;BR /&gt;A1 1&lt;BR /&gt;A1 1&lt;BR /&gt;A1 1&lt;BR /&gt;A2 1&lt;BR /&gt;A2 1&lt;BR /&gt;A2 1&lt;BR /&gt;A2 1&lt;BR /&gt;A2 1&lt;BR /&gt;A2 1&lt;BR /&gt;A2 1&lt;BR /&gt;A2 1&lt;BR /&gt;A3 1&lt;BR /&gt;A3 1&lt;BR /&gt;A3 1&lt;BR /&gt;A3 1&lt;BR /&gt;A3 1&lt;BR /&gt;A3 1&lt;BR /&gt;A4 1&lt;BR /&gt;A4 1&lt;BR /&gt;A4 1&lt;BR /&gt;A5 1&lt;BR /&gt;A5 1&lt;BR /&gt;A5 1&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;proc sql ;&lt;/P&gt;&lt;P&gt;select count(distinct alert_id ) into :n from alert;&lt;BR /&gt;select distinct alert_id into :ant1 - :ant1%left(&amp;amp;n) from alert;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%macro splitd;&lt;BR /&gt;%do i =1 %to &amp;amp;n;&lt;BR /&gt;%put &amp;amp;&amp;amp;ant&amp;amp;i.;&lt;BR /&gt;data &amp;amp;&amp;amp;ant&amp;amp;i.;&lt;BR /&gt;set alert;&lt;BR /&gt;where alert_id=resolve("&amp;amp;&amp;amp;ant&amp;amp;i.") ;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table count&amp;amp;i as&lt;BR /&gt;select distinct alert_id ,count(* ) as totaobs from work.&amp;amp;&amp;amp;ant&amp;amp;i.&lt;BR /&gt;group by alert_id;&lt;BR /&gt;select totaobs into :nb&amp;amp;i from count&amp;amp;i;&lt;BR /&gt;quit;&lt;BR /&gt;%put &amp;amp;&amp;amp;nbl&amp;amp;i;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%let totalds&amp;amp;i=%sysevalf(%left(&amp;amp;&amp;amp;nb&amp;amp;i.)/10,ceil);&lt;BR /&gt;%put &amp;amp;&amp;amp;totalds&amp;amp;i.;&lt;BR /&gt;%if &amp;amp;&amp;amp;nb&amp;amp;i. &amp;gt;=10 %then %do;&lt;BR /&gt;DATA&lt;BR /&gt;%DO J=1 %TO &amp;amp;&amp;amp;totalds&amp;amp;i.;&lt;BR /&gt;WANT_&amp;amp;i.&amp;amp;j.&lt;BR /&gt;%END;;&lt;/P&gt;&lt;P&gt;SET work.&amp;amp;&amp;amp;ant&amp;amp;i.;&lt;/P&gt;&lt;P&gt;%DO J=1 %TO &amp;amp;&amp;amp;totalds&amp;amp;i.;&lt;/P&gt;&lt;P&gt;%IF &amp;amp;J. &amp;gt; 1 %THEN %DO; ELSE %END; IF _N_ LE 10* &amp;amp;J. THEN OUTPUT WANT_&amp;amp;i.&amp;amp;j.;&lt;/P&gt;&lt;P&gt;%END;&lt;BR /&gt;RUN;&lt;BR /&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%END;;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;%mend;&lt;BR /&gt;%splitd;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2019 16:56:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-different-datasets-by-appending-small-once-limit-to-10/m-p/551141#M153199</guid>
      <dc:creator>basani</dc:creator>
      <dc:date>2019-04-15T16:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: Creating different datasets by appending small once limit to 10 Alert_id cannot be over flow.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-different-datasets-by-appending-small-once-limit-to-10/m-p/551418#M153202</link>
      <description>&lt;P&gt;Please try the below code, the count variable carries the number of observation within alert_id if observations are &amp;lt;=10 then all those alert_id records will be outputted to a new dataset want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data want(where=(count&amp;lt;=10));
do until(last.alert_id);
set alert;
by alert_id;
retain count;
if first.alert_id then count=1;
else count+1;
end;
do until(last.alert_id);
set alert;
by alert_id;
output;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 16 Apr 2019 15:32:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-different-datasets-by-appending-small-once-limit-to-10/m-p/551418#M153202</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-04-16T15:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating different datasets by appending small once limit to 10 Alert_id cannot be over flow.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-different-datasets-by-appending-small-once-limit-to-10/m-p/551431#M153213</link>
      <description>It is creating want single dataset which contains 20 orbs from alert, what&lt;BR /&gt;is I required is a2’s 8 observations in 1 dataset and reaming a3 and a4 in&lt;BR /&gt;one a5 in 1 dataset each dataset should not be more than 10 obs and alertid&lt;BR /&gt;should not fall in another dataset, please help me . Thank you for your&lt;BR /&gt;reply</description>
      <pubDate>Tue, 16 Apr 2019 15:58:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-different-datasets-by-appending-small-once-limit-to-10/m-p/551431#M153213</guid>
      <dc:creator>basani</dc:creator>
      <dc:date>2019-04-16T15:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Creating different datasets by appending small once limit to 10 Alert_id cannot be over flow.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-different-datasets-by-appending-small-once-limit-to-10/m-p/551488#M153236</link>
      <description>&lt;P&gt;Hi Jag,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for reply . Here my need to create dataset with limit of 10 and alert_id should not fall under .&lt;/P&gt;&lt;P&gt;for example A1 have 16 , 10 can be created in 1 file and 6 can be created in 1 file.&lt;/P&gt;&lt;P&gt;for A2 there are 8 observations 1 dataset should create.&lt;/P&gt;&lt;P&gt;A3 and A4 has 9 sothat can be created 1 dataset togather .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="impact,chicago" size="5"&gt;&lt;STRONG&gt;Can Any one of you reply on this urgent please a bit&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Apr 2019 17:55:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-different-datasets-by-appending-small-once-limit-to-10/m-p/551488#M153236</guid>
      <dc:creator>basani</dc:creator>
      <dc:date>2019-04-16T17:55:12Z</dc:date>
    </item>
  </channel>
</rss>

