<?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: Selecting specific column from an array. in SAS Health and Life Sciences</title>
    <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100933#M1791</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A few questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q1) For each patient (row) is Day1 the same as Start_date? If not, how do you figure out which Day column relates to Start_date?&lt;/P&gt;&lt;P&gt;Q2) If you always want 365 Day columns what is End_date for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Oct 2013 11:48:24 GMT</pubDate>
    <dc:creator>Amir</dc:creator>
    <dc:date>2013-10-02T11:48:24Z</dc:date>
    <item>
      <title>Selecting specific column from an array.</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100932#M1790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a dataset where each row represents a patient and each column a day. The columns have 0 if the patient is on no medication, 1 if the patient is on one medication, 2 if the patient is on 2 medications and so on. There are 1825 days in the form of an array day1-day1825. I need to select 365 days from these 1825 days for each patient. The start and end date will vary for each patient. How do I create this new array of 365 days for each patient based on the individual patients specific start and end date. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I have&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Patient_id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start_date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End_date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Day1.......day1825&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I need&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Patient_Id&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Start_date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End_date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Day1...day365&lt;/P&gt;&lt;P&gt;Based on each individual patients start and end date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any guidance will be appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pooja Desai&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The University of Texas at Austin &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 08:50:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100932#M1790</guid>
      <dc:creator>Pooja</dc:creator>
      <dc:date>2013-10-02T08:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting specific column from an array.</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100933#M1791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A few questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Q1) For each patient (row) is Day1 the same as Start_date? If not, how do you figure out which Day column relates to Start_date?&lt;/P&gt;&lt;P&gt;Q2) If you always want 365 Day columns what is End_date for?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Amir.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 11:48:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100933#M1791</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2013-10-02T11:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting specific column from an array.</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100934#M1792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I assume you know exactly what date is equivalent to day1 of collection. In order to appropriately build the sub-array, I would go as follow&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let collection_day1_date=01MAY2011;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array day{*} day1-day1825;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array newday{*} newday1-newday365;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; index=intck('day', start_date, "&amp;amp;collection_day1_date"d);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to 365;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newday{i}=day{index+i};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop day: index i;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 12:52:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100934#M1792</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2013-10-02T12:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting specific column from an array.</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100935#M1793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How would you do this if you weren't allowed to use computers?&amp;nbsp; What could you look at in the data that would tell you what you want to know? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, how do&amp;nbsp; you know that each patient should end 365 days after starting?&amp;nbsp; Would&amp;nbsp; you want to confirm that by looking at the data?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 12:57:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100935#M1793</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-10-02T12:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting specific column from an array.</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100936#M1794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Astounding, I understand your point but as as with any study, there should be test candidates with effectively 0 drugs taken from start to end so you can use a change from 0 to 1 in the 1825 days array as a starting point nor the shift back from n to 0 as the end date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is also a chance that the minimum start_date is not equivalent to day1. Think the official study date starts on may01 but patients only came in to get drugs by may03 after being contacted on may01-may02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ultimately, there should be additionnal condition to the new array creation in case someone can have a start-end period less than 365 days yet still have drug count NE 0 between end date and the 365 days loop but I simply assumed that the drugs counted for the study were those prescribed for and by the study such that day{i} is uniformely 0 for all days not between start_date and end_date. Still, I agree that setting days to missing or some other code instead of 0 whenever the patient left the study early allows for more flexibility for data analysis which can be derived from start and end date.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 13:14:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100936#M1794</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2013-10-02T13:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting specific column from an array.</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100937#M1795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Vince,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your code. What exactly do you mean by day1 of collection? I know which day the 365 day period for each patient starts and which day it ends. Please could you clarify? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;day{i} would not necessarily be 0 for days outside of the start_date and end_date. I need a particular snapshot of the data and hence I am trying to get 365 out of the 1825 days.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 14:48:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100937#M1795</guid>
      <dc:creator>Pooja</dc:creator>
      <dc:date>2013-10-02T14:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting specific column from an array.</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100938#M1796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Amir,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For each patient day1 is not the same as the start_date. I have the start_date as a separate variable which is a continuous number between 1 and 1825.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You are right I want to have exactly 365 days following start_date so end_date would be irrelevant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt; &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 14:51:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100938#M1796</guid>
      <dc:creator>Pooja</dc:creator>
      <dc:date>2013-10-02T14:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting specific column from an array.</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100939#M1797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So the start and end date represent the 365 days you want?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What date does day one correspond to?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 14:52:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100939#M1797</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-10-02T14:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting specific column from an array.</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100940#M1798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had data over a longer period so day1 is the day they indexed on the medication. However I need data only over a particular 365 days snapshot. Yes start_day and end_day are continuous numbers between 1 and 1825 and represent the 365 day period over which I need data. The final product I am hoping for is a new array newday1-newday365.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 14:56:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100940#M1798</guid>
      <dc:creator>Pooja</dc:creator>
      <dc:date>2013-10-02T14:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting specific column from an array.</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100941#M1799</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;day1 of collection would be the date to which your current variable day1 refers to. That is, you have data gathered over 1825 days or 5 years. If your study took place from 01JUNE2006 to 31MAY2011, then "day1 of collection" would be 01JUNE2006. What my code example does is take the number of days between START_DATE and this 01JUNE2006 to find which array column to begin with for each patient and simply copies the 365 following values to a new array.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had merely used a macro variable to clearly depict that you need to know what date "day1" variable in your dataset refers to. You could very well just hard type that date in the intck function's 3rd parameter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vincent&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 14:59:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100941#M1799</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2013-10-02T14:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting specific column from an array.</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100942#M1800</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;O wait, start_date and end_date are not actual date values but simply values ranging from 1-1825? If so, it is even more straight forward as you can use start_date to index day{} directly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array day{*} day1-day1825;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array newday{*} newday1-newday365;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to 365;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newday{i}=day{start_date+i-1};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; drop day: i;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 15:02:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100942#M1800</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2013-10-02T15:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting specific column from an array.</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100943#M1801</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the clarification Vincent. I used the code but for the newday array I get all missing values. All the 365 columns for all the patients are missing. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 15:08:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100943#M1801</guid>
      <dc:creator>Pooja</dc:creator>
      <dc:date>2013-10-02T15:08:48Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting specific column from an array.</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100944#M1802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post some sample data. Vince's code should have worked, so there's something else missing.&lt;/P&gt;&lt;P&gt;Was there anything else in the log?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example is this how your data looks like?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Patient_id &lt;/TD&gt;&lt;TD&gt;Start_date&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt;End_date &lt;/TD&gt;&lt;TD&gt;Day1.......day1825&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 367&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0&amp;nbsp; 0 0 1 2.....2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 15:11:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100944#M1802</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-10-02T15:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting specific column from an array.</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100945#M1803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reeza,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vince's code ran with no errors. Only the newday array had missing values for all the columns. The data look exactly like how you described it.&lt;/P&gt;&lt;P&gt;The output dataset was like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Patient_ID&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; start_dat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; end_day&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; day1......day1825&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; newday1....newday365&lt;/P&gt;&lt;P&gt;111&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 367&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 1 1 1 1 2 2 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ............................&lt;/P&gt;&lt;P&gt;with the entire newday array missing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 15:16:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100945#M1803</guid>
      <dc:creator>Pooja</dc:creator>
      <dc:date>2013-10-02T15:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting specific column from an array.</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100946#M1804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;If you copy pasted my code above and did not remove the drop statement, then it means that your variables day1-day1825 are only labeled day1-day1825 and actually bear a different name. Thus, 1825 missing values were created to populate 365 missing values, the former 1825 created were dropped but the actual appropriate columns were never used because they are not named appropriately&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Had they been named day1-day1825, they would have been removed from the output dataset completely assuming you kept the drop statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;P.s. I am leaving work at noon today so I won't be able to provide any further debugging until tomorrow if the above does not solve your issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 15:42:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100946#M1804</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2013-10-02T15:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Selecting specific column from an array.</title>
      <link>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100947#M1805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oops..you're right Vince, I forgot to change the variable name!:smileyblush:&lt;/P&gt;&lt;P&gt;Thanks a lot for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 16:47:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Health-and-Life-Sciences/Selecting-specific-column-from-an-array/m-p/100947#M1805</guid>
      <dc:creator>Pooja</dc:creator>
      <dc:date>2013-10-02T16:47:18Z</dc:date>
    </item>
  </channel>
</rss>

