<?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: Add 3 more dates to each of the dates for observations (using INTNX and array) in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840395#M36428</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/436402"&gt;@femiajumobi1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks, Tom, Yes this is is exactly what I am trying to do but in the context of a huge dataset.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So what should happen with other variables in the data set? Do you want three additional values of each variable? For the other variables to be missing on one or more of the added dates? Something else?&lt;/P&gt;</description>
    <pubDate>Mon, 24 Oct 2022 21:18:54 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2022-10-24T21:18:54Z</dc:date>
    <item>
      <title>Add 3 more dates to each of the dates for observations (using INTNX and array)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840343#M36420</link>
      <description>&lt;PRE&gt;&lt;CODE class=""&gt;Data x;
array datex{*};
day=intnx('dtday', datex'dt, 3); /* +3 days */
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have data x with variable datex in format mmddyy10. I need to create 3 more dates consecutively for each observation. for example please see below (index date for obs 1 = 01/01/2022 and&amp;nbsp; for obs 2 = 02/03/2022),&lt;/P&gt;&lt;P&gt;obs&amp;nbsp; datex&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/01/2022&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/02/2022&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/03/2022&lt;/P&gt;&lt;P&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 01/04/2022&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/03/2022&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/04/2022&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/05/2022&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 02/06/2022&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I do this with array and INTNX? This and any other approach is well appreciated. Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 18:52:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840343#M36420</guid>
      <dc:creator>femiajumobi1</dc:creator>
      <dc:date>2022-10-24T18:52:49Z</dc:date>
    </item>
    <item>
      <title>Re: Add 3 more dates to each of the dates for observations (using INTNX and array)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840346#M36421</link>
      <description>&lt;P&gt;Your data step does not read anything, so it will have nothing to initialize the values.&lt;/P&gt;
&lt;P&gt;You use the DTDAY interval, which is for datetimes, but you seem to want to work with dates.&lt;/P&gt;
&lt;P&gt;So please show us the real data you &lt;U&gt;have&lt;/U&gt;, with their real types (date or datetime), from which you want to get the dataset you show in your post.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 18:59:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840346#M36421</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-10-24T18:59:50Z</dc:date>
    </item>
    <item>
      <title>Re: Add 3 more dates to each of the dates for observations (using INTNX and array)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840354#M36422</link>
      <description>&lt;P&gt;Is this what you are trying to do?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  obs+1 ;
  input datex :mmddyy. ;
  format datex yymmdd10.;
cards;
01/01/2022
02/03/2022 
;

data want;
  set have;
  do datex=datex to datex+3;
    output;
  end;
run;

proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1666639033866.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76503iB625AA7ED3CEF833/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1666639033866.png" alt="Tom_0-1666639033866.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Note: There is no need to use INTNX() when incrementing by the unit that the value is using.&amp;nbsp; Days for Dates,&amp;nbsp; Seconds for Time or DateTime.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 19:18:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840354#M36422</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-24T19:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Add 3 more dates to each of the dates for observations (using INTNX and array)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840355#M36423</link>
      <description>&lt;P&gt;Thanks, Kurt_Bremser, for your prompt response. That was a mistake. It is date not datetime. Please see below "&lt;STRONG&gt;Data A&lt;/STRONG&gt;" and I will like to add 3 more dates incrementally by 1 to each of the observation to give me "&lt;STRONG&gt;Data B&lt;/STRONG&gt;"&lt;BR /&gt;&lt;STRONG&gt;Data A&lt;/STRONG&gt;&lt;BR /&gt;obs datex&lt;BR /&gt;1 01/01/2022&lt;BR /&gt;2 02/03/2022&lt;BR /&gt;.. ...................&lt;BR /&gt;n 10/24/2022&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Data B&lt;/STRONG&gt;&lt;BR /&gt;obs datex&lt;BR /&gt;1 01/01/2022&lt;BR /&gt;1 01/02/2022&lt;BR /&gt;1 01/03/2022&lt;BR /&gt;1 01/04/2022&lt;BR /&gt;2 02/03/2022&lt;BR /&gt;2 02/04/2022&lt;BR /&gt;2 02/05/2022&lt;/P&gt;&lt;P&gt;2 02/06/2022&lt;/P&gt;&lt;P&gt;..&amp;nbsp; .................&lt;/P&gt;&lt;P&gt;n 10/24/2022&lt;/P&gt;&lt;P&gt;n 10/25/2022&lt;/P&gt;&lt;P&gt;n 10/26/2022&lt;/P&gt;&lt;P&gt;n 10/27/2022&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 19:18:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840355#M36423</guid>
      <dc:creator>femiajumobi1</dc:creator>
      <dc:date>2022-10-24T19:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Add 3 more dates to each of the dates for observations (using INTNX and array)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840356#M36424</link>
      <description>&lt;P&gt;Thanks, Tom, Yes this is is exactly what I am trying to do but in the context of a huge dataset.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 19:30:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840356#M36424</guid>
      <dc:creator>femiajumobi1</dc:creator>
      <dc:date>2022-10-24T19:30:04Z</dc:date>
    </item>
    <item>
      <title>Re: Add 3 more dates to each of the dates for observations (using INTNX and array)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840358#M36425</link>
      <description>&lt;P&gt;Size of data set is irrelevant, approach is the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;data want;
  set have; *specify input data set;
  do datex=datex to datex+3; *increment date once for each day;
    output; *write record to data set;
  end;
run;&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 24 Oct 2022 19:50:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840358#M36425</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-24T19:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Add 3 more dates to each of the dates for observations (using INTNX and array)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840395#M36428</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/436402"&gt;@femiajumobi1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks, Tom, Yes this is is exactly what I am trying to do but in the context of a huge dataset.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;So what should happen with other variables in the data set? Do you want three additional values of each variable? For the other variables to be missing on one or more of the added dates? Something else?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 21:18:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840395#M36428</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-24T21:18:54Z</dc:date>
    </item>
    <item>
      <title>Re: Add 3 more dates to each of the dates for observations (using INTNX and array)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840402#M36430</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/436402"&gt;@femiajumobi1&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks, Tom, Yes this is is exactly what I am trying to do but in the context of a huge dataset.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You probably need to explain the larger context that made you think it made sense to quadruple the size of the dataset then.&lt;/P&gt;
&lt;P&gt;What is the problem are trying to fix or the analysis you are trying to do?&lt;/P&gt;
&lt;P&gt;What is the reason you thought it would help to replicate the data four times?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 21:36:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840402#M36430</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-10-24T21:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: Add 3 more dates to each of the dates for observations (using INTNX and array)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840410#M36431</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom, so, this is it:&lt;/P&gt;&lt;P&gt;the dataset is service data but I have to merge it with pharmacy data for a specific medication.&amp;nbsp; In my situation, when one gets a prescription at the hospital (service data), it is expected it would be filled within 3days at the pharmacy (pharmacy data), that's someone is expected to buy his medication within 3 days of being given a prescription at the hospital.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thus, I thought of creating a scenario of additional 3days (3 succeeding dates [date_x]) during which someone can fill his prescription at the pharmacy. I am interested in merging service data to a prescription that was filled within 3days in pharmacy data (pharmacy data has its own dates, date_y). And that what why I was thinking I need to create a window period of 3days for which I could merge the data such that the service aligns with the prescription received within 3days (not outside of the 3days), but I am not sure how to do this with INTNX and array at the merging phase.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 22:31:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840410#M36431</guid>
      <dc:creator>femiajumobi1</dc:creator>
      <dc:date>2022-10-24T22:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: Add 3 more dates to each of the dates for observations (using INTNX and array)</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840411#M36432</link>
      <description>No...you join within a three days interval. If you provide samples of each input data set and expected output someone can help you with the code.&lt;BR /&gt;&lt;BR /&gt;I also question your three day interval, except in the case of opioids if you're doing opioid drug monitoring. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 24 Oct 2022 22:41:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Add-3-more-dates-to-each-of-the-dates-for-observations-using/m-p/840411#M36432</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-10-24T22:41:54Z</dc:date>
    </item>
  </channel>
</rss>

