<?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: How to give for every ten observation as 0 for remaining as 1? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-give-for-every-ten-observation-as-0-for-remaining-as-1/m-p/420022#M103326</link>
    <description>&lt;P&gt;I'm not sure I get this, but do something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x y z;
do i=1 to 1000; output; end;
datalines;
1 2 3
;

data want;
	set have;
	newVar=1;
	if mod(_n_,10)=1 then newVar=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 11 Dec 2017 07:26:25 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2017-12-11T07:26:25Z</dc:date>
    <item>
      <title>How to give for every ten observation as 0 for remaining as 1?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-give-for-every-ten-observation-as-0-for-remaining-as-1/m-p/419990#M103313</link>
      <description>&lt;P&gt;I"m having a dataset contains 1000 observations I need to present for every 10 observations as 0 and for remaing all are as 1?&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 00:14:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-give-for-every-ten-observation-as-0-for-remaining-as-1/m-p/419990#M103313</guid>
      <dc:creator>rajeshalwayswel</dc:creator>
      <dc:date>2017-12-11T00:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to give for every ten observation as 0 for remaining as 1?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-give-for-every-ten-observation-as-0-for-remaining-as-1/m-p/419998#M103316</link>
      <description>&lt;P&gt;Any attempts you had done?&amp;nbsp; Post your code.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Dec 2017 02:27:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-give-for-every-ten-observation-as-0-for-remaining-as-1/m-p/419998#M103316</guid>
      <dc:creator>ShiroAmada</dc:creator>
      <dc:date>2017-12-11T02:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to give for every ten observation as 0 for remaining as 1?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-give-for-every-ten-observation-as-0-for-remaining-as-1/m-p/420004#M103319</link>
      <description>&lt;P&gt;So you want to a new variable that is 0 for every tenth observation?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  newgroup = not 0=mod(_n_,10);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Dec 2017 03:50:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-give-for-every-ten-observation-as-0-for-remaining-as-1/m-p/420004#M103319</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-12-11T03:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to give for every ten observation as 0 for remaining as 1?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-give-for-every-ten-observation-as-0-for-remaining-as-1/m-p/420022#M103326</link>
      <description>&lt;P&gt;I'm not sure I get this, but do something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input x y z;
do i=1 to 1000; output; end;
datalines;
1 2 3
;

data want;
	set have;
	newVar=1;
	if mod(_n_,10)=1 then newVar=0;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Dec 2017 07:26:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-give-for-every-ten-observation-as-0-for-remaining-as-1/m-p/420022#M103326</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-12-11T07:26:25Z</dc:date>
    </item>
  </channel>
</rss>

