<?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: DATA STEP in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DATA-STEP/m-p/239222#M43974</link>
    <description>If you have any other special missing values that also won't give you the same results.&lt;BR /&gt;&lt;BR /&gt;data have;&lt;BR /&gt;a=.; b=2; output;&lt;BR /&gt;a=1; b=.N; output;&lt;BR /&gt;a=2; b=3; output;&lt;BR /&gt;a=.; b=.; output;&lt;BR /&gt;a=.A; b=.A; output;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;if a ne . and b ne . then flag=1;&lt;BR /&gt;else flag=0;&lt;BR /&gt;x=n(a,b);&lt;BR /&gt;run;</description>
    <pubDate>Mon, 14 Dec 2015 18:21:28 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2015-12-14T18:21:28Z</dc:date>
    <item>
      <title>DATA STEP</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATA-STEP/m-p/239207#M43970</link>
      <description>&lt;P&gt;IS THE "COMMENTED" AND THE "NON SCOMMENTED" LINES DOING THE SAME THING IN THE BELOW CODE????&lt;/P&gt;&lt;P&gt;THANKS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;set&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2" face="Courier New"&gt;&lt;FONT size="2" face="Courier New"&gt; ints_exts2;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;array&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2" face="Courier New"&gt;&lt;FONT size="2" face="Courier New"&gt; ins int:; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;array&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2" face="Courier New"&gt;&lt;FONT size="2" face="Courier New"&gt; outs ext:;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;do&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2" face="Courier New"&gt;&lt;FONT size="2" face="Courier New"&gt; i = &lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" size="2" face="Courier New"&gt;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;to&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2" face="Courier New"&gt;&lt;FONT size="2" face="Courier New"&gt; dim(ins);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;if&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2" face="Courier New"&gt;&lt;FONT size="2" face="Courier New"&gt; ins(i)^=&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2" face="Courier New"&gt;&lt;FONT size="2" face="Courier New"&gt; and outs(i)^=&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" size="2" face="Courier New"&gt;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;&lt;FONT color="#0000ff" size="2" face="Courier New"&gt;then&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="2" face="Courier New"&gt;&lt;FONT size="2" face="Courier New"&gt; duration=sum(duration,outs(i)-ins(i)) /*UNCOMMENTED*/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;FONT color="#008000" size="2" face="Courier New"&gt;&lt;FONT color="#008000" size="2" face="Courier New"&gt;&lt;FONT color="#008000" size="2" face="Courier New"&gt;*if 2=N(ins(i),outs(i)) then duration=sum(duration,outs(i)-ins(i));&amp;nbsp;&amp;nbsp;&amp;nbsp; /*COMMENTED*/&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;end&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;FONT size="2" face="Courier New"&gt;&lt;FONT size="2" face="Courier New"&gt;; &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;days = datepart(duration);&lt;/P&gt;&lt;P&gt;time = timepart(duration);&lt;/P&gt;&lt;P&gt;hrs=time/(&lt;STRONG&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;60&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2" face="Courier New"&gt;&lt;FONT size="2" face="Courier New"&gt;*&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;60&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2" face="Courier New"&gt;&lt;FONT size="2" face="Courier New"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Total_vent_hours =days*&lt;STRONG&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;24&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2" face="Courier New"&gt;&lt;FONT size="2" face="Courier New"&gt;+ time/(&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;60&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2" face="Courier New"&gt;&lt;FONT size="2" face="Courier New"&gt;*&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;60&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2" face="Courier New"&gt;&lt;FONT size="2" face="Courier New"&gt;);&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;vent_days=Total_vent_hours/&lt;STRONG&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;&lt;FONT color="#008080" size="2" face="Courier New"&gt;24&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2" face="Courier New"&gt;&lt;FONT size="2" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;STRONG&gt;&lt;FONT color="#000080" size="2" face="Courier New"&gt;&lt;FONT color="#000080" size="2" face="Courier New"&gt;&lt;FONT color="#000080" size="2" face="Courier New"&gt;run&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT size="2" face="Courier New"&gt;&lt;FONT size="2" face="Courier New"&gt;;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2015 17:55:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATA-STEP/m-p/239207#M43970</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2015-12-14T17:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: DATA STEP</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATA-STEP/m-p/239213#M43972</link>
      <description>&lt;P&gt;Not exactly as the Not missing, ^=., works for character variables while N(variables) requires all of the arguments to be numeric.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you are dealing with mixed data types you might want CMISS(ins[i], out[i]) = 0&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2015 18:13:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATA-STEP/m-p/239213#M43972</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-12-14T18:13:13Z</dc:date>
    </item>
    <item>
      <title>Re: DATA STEP</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATA-STEP/m-p/239222#M43974</link>
      <description>If you have any other special missing values that also won't give you the same results.&lt;BR /&gt;&lt;BR /&gt;data have;&lt;BR /&gt;a=.; b=2; output;&lt;BR /&gt;a=1; b=.N; output;&lt;BR /&gt;a=2; b=3; output;&lt;BR /&gt;a=.; b=.; output;&lt;BR /&gt;a=.A; b=.A; output;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;data want;&lt;BR /&gt;set have;&lt;BR /&gt;if a ne . and b ne . then flag=1;&lt;BR /&gt;else flag=0;&lt;BR /&gt;x=n(a,b);&lt;BR /&gt;run;</description>
      <pubDate>Mon, 14 Dec 2015 18:21:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATA-STEP/m-p/239222#M43974</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-14T18:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: DATA STEP</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATA-STEP/m-p/239223#M43975</link>
      <description>&lt;P&gt;Thanks Reeza.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;INS and OUTS arrays contain dates only. Can have missing values.&lt;/P&gt;&lt;P&gt;Wanted toi know if in that case both line output the same results??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2015 18:29:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATA-STEP/m-p/239223#M43975</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2015-12-14T18:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: DATA STEP</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATA-STEP/m-p/239232#M43979</link>
      <description>&lt;P&gt;You could check with:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;compare =(ins(i)^=&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="2"&gt;&lt;FONT face="Courier New" size="2"&gt; and outs(i)^=&lt;/FONT&gt;&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;.) = (&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;&lt;FONT color="#008000" face="Courier New" size="2"&gt;N(ins(i),outs(i)));&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2015 19:35:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATA-STEP/m-p/239232#M43979</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-12-14T19:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: DATA STEP</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DATA-STEP/m-p/239242#M43981</link>
      <description>If you have a very specific scenario, it's faster to test it than ask. In general, no it won't, for your case it may, as long as you can guarantee that it will always stay that way.</description>
      <pubDate>Mon, 14 Dec 2015 20:26:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DATA-STEP/m-p/239242#M43981</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2015-12-14T20:26:09Z</dc:date>
    </item>
  </channel>
</rss>

