<?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 creating array of data set and performing loop. in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/creating-array-of-data-set-and-performing-loop/m-p/336794#M1964</link>
    <description>&lt;P&gt;data RandClass(drop=i);&lt;BR /&gt;call streaminit(1234);&lt;BR /&gt;set sashelp.cars(keep= Cylinders Horsepower EngineSize);&lt;BR /&gt;array x {*} _numeric_;&lt;BR /&gt;do i = 1 to dim(x);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if rand("Bern", 0.1) then&lt;BR /&gt;&amp;nbsp;&amp;nbsp; x[i]=.;&amp;nbsp; /* p=0.4 ==&amp;gt; about 40% missing */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello everyone, this is my code to delete values from columns randomly. It is working completely fine.&lt;/P&gt;&lt;P&gt;In the code 0.1 decides the percentage to delete. if i write there 0.2 it will delete 20% of the values and so on. I want to run a loop there that it will select values from 0.1 to 0.4 by 0.05. so total it should do 7 times. and I want to store all this 7 databases for future use. can anyone help me to do it ?&lt;/P&gt;</description>
    <pubDate>Tue, 28 Feb 2017 23:59:08 GMT</pubDate>
    <dc:creator>chintanpatel</dc:creator>
    <dc:date>2017-02-28T23:59:08Z</dc:date>
    <item>
      <title>creating array of data set and performing loop.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/creating-array-of-data-set-and-performing-loop/m-p/336794#M1964</link>
      <description>&lt;P&gt;data RandClass(drop=i);&lt;BR /&gt;call streaminit(1234);&lt;BR /&gt;set sashelp.cars(keep= Cylinders Horsepower EngineSize);&lt;BR /&gt;array x {*} _numeric_;&lt;BR /&gt;do i = 1 to dim(x);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if rand("Bern", 0.1) then&lt;BR /&gt;&amp;nbsp;&amp;nbsp; x[i]=.;&amp;nbsp; /* p=0.4 ==&amp;gt; about 40% missing */&lt;BR /&gt;&amp;nbsp;&amp;nbsp; end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hello everyone, this is my code to delete values from columns randomly. It is working completely fine.&lt;/P&gt;&lt;P&gt;In the code 0.1 decides the percentage to delete. if i write there 0.2 it will delete 20% of the values and so on. I want to run a loop there that it will select values from 0.1 to 0.4 by 0.05. so total it should do 7 times. and I want to store all this 7 databases for future use. can anyone help me to do it ?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2017 23:59:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/creating-array-of-data-set-and-performing-loop/m-p/336794#M1964</guid>
      <dc:creator>chintanpatel</dc:creator>
      <dc:date>2017-02-28T23:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: creating array of data set and performing loop.</title>
      <link>https://communities.sas.com/t5/SAS-Studio/creating-array-of-data-set-and-performing-loop/m-p/336796#M1965</link>
      <description>&lt;P&gt;Here's one way. Another is to use a macro loop to generate the data you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data RandClass;
	call streaminit(1234);
	set sashelp.cars(keep= Cylinders Horsepower EngineSize obs=50);
	array x {*} _numeric_;

	do p=0.1 to 0.5 by 0.1;
		do i = 1 to dim(x);
			if rand("Bern", p) then
				x[i]=.;
		end;

		output;
	end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Mar 2017 00:07:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/creating-array-of-data-set-and-performing-loop/m-p/336796#M1965</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-03-01T00:07:32Z</dc:date>
    </item>
  </channel>
</rss>

