<?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: Array logic in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123007#M33820</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cleaarly I see that after I used the code.&lt;/P&gt;&lt;P&gt;the vent_array dataset has observations for which there is non missing vint and vext as well&lt;/P&gt;&lt;P&gt;like shown and also either of them missing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vint&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vext&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value&lt;/P&gt;&lt;P&gt;missing&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value&lt;/P&gt;&lt;P&gt;value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; missing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And these are all within the admissin discharge date ranges...&lt;/P&gt;&lt;P&gt;EVEN THE ONES WITH : &lt;/P&gt;&lt;P&gt;missing&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value &lt;/P&gt;&lt;P&gt;THE VALUE IS WITHIN THE DATE RANGE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So How can I get to kNOW THE OBSERVATIONS WHOSE VINT AND VEXT ARE NOT WITHIN THE VALID RANGE OF INTUBATE AND EXTUBATES SEPERATELY????????/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aLSO WHEN WE SAID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; IF nmiss(vint, vext)&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; vent_array;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;WHY IS IT STILL OUTPUTTING OBSERVATIONS WHERE BOTH VALUES ARE NON-MISSING &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;LIKE &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;VALUE&amp;nbsp;&amp;nbsp;&amp;nbsp; VALUE&amp;nbsp; AS SHOWN ABOVE&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 27 Apr 2013 18:04:28 GMT</pubDate>
    <dc:creator>robertrao</dc:creator>
    <dc:date>2013-04-27T18:04:28Z</dc:date>
    <item>
      <title>Array logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123004#M33817</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;I was learning about different things in Arrays.&lt;/P&gt;&lt;P&gt;I have a couple of questions in the below code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)what is the use of &lt;STRONG style="color: #000080; font-family: Courier New;"&gt;vint=.; vext=. for the variables being created;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080; font-family: Courier New;"&gt;2)why did we write this&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080; font-family: Courier New;"&gt;if nmiss(vint, vext)&amp;lt; 2 then output vent_array;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080; font-family: Courier New;"&gt;3)what happens if we dont write the above step?????/&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080; font-family: Courier New;"&gt;Thanks&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;data vent_array;&lt;/P&gt;&lt;P&gt;format&amp;nbsp; vint vext datetime.;&amp;nbsp; &lt;BR /&gt;set have(keep=visit_id mrn1 admission_date discharged&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itb1-itb12 ext1-ext12);&lt;BR /&gt;by mrn1;&lt;BR /&gt;array intubate{12} itb1-itb12;&lt;BR /&gt;array extubate{12} ext1-ext12;&lt;BR /&gt;do i=1 to 12;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080; font-family: Courier New;"&gt;vint=.; vext=.;&lt;BR /&gt;if admission_date &amp;lt;= intubate{i} &amp;lt;= discharged then vint=intubate(i);&lt;BR /&gt;if admission_date &amp;lt;= extubate{i} &amp;lt;= discharged then vext=extubate(i);&lt;BR /&gt;if nmiss(vint, vext)&amp;lt; 2 then output vent_array;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Apr 2013 16:34:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123004#M33817</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-04-27T16:34:52Z</dc:date>
    </item>
    <item>
      <title>Re: Array logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123005#M33818</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;Note: The code is missing at least &lt;STRONG&gt;end; run;&lt;/STRONG&gt; at the end.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial,helvetica,sans-serif;"&gt;1) &lt;SPAN style="color: #000080;"&gt;vint=.; vext=.; resets the default value for these variables as missing instead of the value they had on the previous iteration of the do loop.. If the tests that follow are not conclusive, the variables vint or vext will be missing.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-family: arial,helvetica,sans-serif;"&gt;2) &lt;SPAN style="color: #000080; font-family: Courier New;"&gt;&lt;STRONG&gt;if nmiss(vint, vext)&amp;lt; 2 The function nmiss returns the number of missing values among its arguments. Here the test condition it will return TRUE if either vint or vext is missing.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-family: Courier New;"&gt;&lt;STRONG&gt;3)This datastep creates a new dataset named vent_array that lists the cases where the intb or ext dates are not valid, i.e. they do not occur between the admission and discharge dates.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000080; font-family: Courier New;"&gt;&lt;STRONG&gt;PG&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Apr 2013 17:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123005#M33818</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-04-27T17:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Array logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123006#M33819</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks PG,&lt;/P&gt;&lt;P&gt;Then I think I messed up with the code...&lt;/P&gt;&lt;P&gt;i was thinking in the below code &lt;STRONG&gt;vent_array&lt;/STRONG&gt; dataset contains the cases where itb or extb occurs between admission and discharge dates..(i see that in the dataset there are some observation which have missing either itb or extb&lt;STRONG&gt;.But majority of them have both the values and are with in the range of admission and discharged....please explain&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;and&lt;STRONG&gt; holding dataset&lt;/STRONG&gt; contains the patients whose itb or extb are past the discharged date&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data vent_array(keep=visit_id mrn1 admission_date discharged vint vext) &lt;BR /&gt;intext.HOLDING(keep= mrn1 vint vext admission_date discharged);&lt;BR /&gt;/*purposely removed visit_id from Holding to make it compatible for appending to fresh data eaCH MONTH*/&lt;BR /&gt;&amp;nbsp; format&amp;nbsp; vint vext datetime.;&amp;nbsp; &lt;BR /&gt;set admitsum_vent(keep=visit_id mrn1 admission_date discharged&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; itb1-itb12 ext1-ext12);&lt;BR /&gt;by mrn1;&lt;BR /&gt;array intubate{12} itb1-itb12;&lt;BR /&gt;array extubate{12} ext1-ext12;&lt;BR /&gt;do i=1 to 12;&lt;BR /&gt;vint=.; vext=.;&lt;BR /&gt;if datepart(admission_date) &amp;lt;= datepart(intubate{i}) &amp;lt;= datepart(discharged) then vint=intubate{i};&lt;BR /&gt;if datepart(admission_date) &amp;lt;= datepart(extubate{i}) &amp;lt;= datepart(discharged) then vext=extubate{i};&lt;BR /&gt;if nmiss(vint, vext)&amp;lt; 2 then output vent_array;&lt;BR /&gt;if last.mrn1 then do;&lt;BR /&gt;do i=1 to 12;&lt;BR /&gt;if datepart(intubate{i}) &amp;gt;= datepart(discharged) or datepart(extubate{i}) &amp;gt;= datepart(discharged) then do;&lt;BR /&gt;/*guys with int/ext past the discharge date are exported to holding dataset*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vint=intubate{i};&lt;BR /&gt;vext=extubate{i};&lt;BR /&gt;output intext.HOLDING;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Apr 2013 17:52:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123006#M33819</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-04-27T17:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: Array logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123007#M33820</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Cleaarly I see that after I used the code.&lt;/P&gt;&lt;P&gt;the vent_array dataset has observations for which there is non missing vint and vext as well&lt;/P&gt;&lt;P&gt;like shown and also either of them missing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vint&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vext&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value&lt;/P&gt;&lt;P&gt;missing&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value&lt;/P&gt;&lt;P&gt;value&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; missing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And these are all within the admissin discharge date ranges...&lt;/P&gt;&lt;P&gt;EVEN THE ONES WITH : &lt;/P&gt;&lt;P&gt;missing&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value &lt;/P&gt;&lt;P&gt;THE VALUE IS WITHIN THE DATE RANGE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So How can I get to kNOW THE OBSERVATIONS WHOSE VINT AND VEXT ARE NOT WITHIN THE VALID RANGE OF INTUBATE AND EXTUBATES SEPERATELY????????/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aLSO WHEN WE SAID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; IF nmiss(vint, vext)&amp;lt; &lt;/SPAN&gt;&lt;SPAN style="; color: #008080; font-size: 10pt; font-family: Courier New;"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;then&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;output&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; vent_array;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;WHY IS IT STILL OUTPUTTING OBSERVATIONS WHERE BOTH VALUES ARE NON-MISSING &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;LIKE &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;VALUE&amp;nbsp;&amp;nbsp;&amp;nbsp; VALUE&amp;nbsp; AS SHOWN ABOVE&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Apr 2013 18:04:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123007#M33820</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-04-27T18:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Array logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123008#M33821</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why not simply use :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;data &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt; vent_array (keep=visit_id mrn1 admission_date discharged vint vext) &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt; intext.HOLDING (keep= mrn1 admission_date discharged vint vext);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;format&amp;nbsp; vint vext datetime.;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;set admitsum_vent;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;array intubate{12} itb1-itb12;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;array extubate{12} ext1-ext12;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;do i=1 to 12;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vint=intubate{i}; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vext=extubate{i};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if admission_date &amp;lt;= vint &amp;lt;= discharged and&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; admission_date &amp;lt;= vext &amp;lt;= discharged then output vent_array;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if vint &amp;gt; discharged or vext &amp;gt; discharged then output intext.HOLDING;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Apr 2013 18:37:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123008#M33821</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-04-27T18:37:06Z</dc:date>
    </item>
    <item>
      <title>Re: Array logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123009#M33822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;thanks for your help. The last. Concept is necessary because there are repeats for the mrn1 and it is only for the record encounter we want to check if the patient intubate or extubate is greater than discharge date because by doing that we will know that the patient is not yet discharged completely and we want to hold that records for future analysis agagain&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Apr 2013 19:49:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123009#M33822</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-04-27T19:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Array logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123010#M33823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am stuck in this logic.Could someone help me figure this out?&lt;/P&gt;&lt;P&gt;As PG explained&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #000080; font-family: Courier New;"&gt;if nmiss(vint, vext)&amp;lt; 2 then output vent_array;&lt;/STRONG&gt;means&lt;/P&gt;&lt;P&gt;if either of them is missing then output to vent_array&lt;/P&gt;&lt;P&gt;But in my case I am getting observations in the vent_array where both of them are non missing as well as either missing&lt;/P&gt;&lt;P&gt;How am I able get to this results...&lt;/P&gt;&lt;P&gt;i wanted those observations which satify those conditions to be in that vent_array&lt;/P&gt;&lt;P&gt;But that highlighted statement usage should not give what I wanted .....But to my surprise&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Apr 2013 20:54:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123010#M33823</guid>
      <dc:creator>robertrao</dc:creator>
      <dc:date>2013-04-27T20:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: Array logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123011#M33824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This then?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;data &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;vent_array (keep = visit_id mrn1 admission_date discharged vint vext) &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;intext.HOLDING (keep = mrn1 admission_date discharged vint vext);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;format&amp;nbsp; vint vext datetime.;&amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;set admitsum_vent; by mrn1;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;array intubate{12} itb1-itb12;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;array extubate{12} ext1-ext12;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;do i = 1 to 12;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vint=intubate{i}; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vext=extubate{i};&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (admission_date &amp;lt;= vint &amp;lt;= discharged) and&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (admission_date &amp;lt;= vext &amp;lt;= discharged) then output vent_array;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if last.mrn1 and (vint &amp;gt; discharged or vext &amp;gt; discharged) then output intext.HOLDING;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-size: 12pt;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Apr 2013 22:13:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123011#M33824</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-04-27T22:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: Array logic</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123012#M33825</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am confused. Your first restatement of the meaning is wrong, but the second is right.&lt;/P&gt;&lt;P&gt;Perhaps the issue you are seeing is because of the loop over 12 elements of the array?&lt;/P&gt;&lt;P&gt;Because of that you will see values of&amp;nbsp; &lt;STRONG&gt;&amp;lt;visit_id mrn1 admission_date discharged&amp;gt;&lt;/STRONG&gt; in VENT_ARRAY when ANY of the 12 pairs have one or zero missing values.&amp;nbsp; The only source records that will not send any records to VENT_ARRAY will be those where ALL of the 24 original variables are missing.&amp;nbsp; Adding the index variable I to the keep list for VENT_ARRAY should help you see this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Apr 2013 23:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Array-logic/m-p/123012#M33825</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-04-27T23:18:00Z</dc:date>
    </item>
  </channel>
</rss>

