<?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 add 21 days in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369337#M275554</link>
    <description>&lt;P&gt;Before adding 21 days, you should describe your input:&lt;/P&gt;
&lt;P&gt;what is the variable name that you want to add to it the 21 days? is it character or numeric type?&lt;/P&gt;
&lt;P&gt;if numeric - is it a sas date? if not, what format is it (ddmmyyyy or yymmdd or date9. etc.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The answer to your question will change according to your answers to those questions.&lt;/P&gt;</description>
    <pubDate>Wed, 21 Jun 2017 20:54:39 GMT</pubDate>
    <dc:creator>Shmuel</dc:creator>
    <dc:date>2017-06-21T20:54:39Z</dc:date>
    <item>
      <title>How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369256#M275549</link>
      <description>Hi team,&lt;BR /&gt;I have a table that uses today dste and I need to add 21 days to it here is what data looks and what I need&lt;BR /&gt;&lt;BR /&gt;Id freq dos lot total&lt;BR /&gt;&lt;BR /&gt;That's what I have i would need a col for today's date and based on that date i would need 21 days added as labels&lt;BR /&gt;Today date id freq dos lot total 06/22/17 06/23/17 06/24/17 06/25/17.....</description>
      <pubDate>Wed, 21 Jun 2017 18:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369256#M275549</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-06-21T18:11:57Z</dc:date>
    </item>
    <item>
      <title>How to add 21 days to data set</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369254#M275551</link>
      <description>Hi team,&lt;BR /&gt;I have a table that uses today dste and I need to add 21 days to it here is what data looks and what I need&lt;BR /&gt;&lt;BR /&gt;Id freq dos lot total&lt;BR /&gt;&lt;BR /&gt;That's what I have i would need a col for today's date and based on that date i would need 21 days added as labels&lt;BR /&gt;Today date id freq dos lot total 06/22/17 06/23/17 06/24/17 06/25/17.....</description>
      <pubDate>Wed, 21 Jun 2017 18:11:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369254#M275551</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-06-21T18:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369281#M275550</link>
      <description>&lt;P&gt;In Today date id freq dos lot total 06/22/17 06/23/17 06/24/17 06/25/17....&lt;/P&gt;
&lt;P&gt;These cannot be variable names: 06/22/17 06/23/17 06/24/17 06/25/17&lt;/P&gt;
&lt;P&gt;SAS variable names are _ or letter followed by _, letter or digit. NO / and cannot start with 0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What values are you going to assign to those new variables? If you don't have a value why have the 21 additional variables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This sounds like you may be trying to replicate some process that was originally done in a spreadsheet. If so you might be much better off describing your starting data and where this ends. Generally having data such as you propose with a separte column for each value of something (dates in this case) is MUCH better processed with a single variable to inicate that value group&amp;nbsp;and another to hole the value.&lt;/P&gt;
&lt;P&gt;There are many tools that work much better with data structured that way and then as a last step create a report with that group as a column heading.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2017 19:06:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369281#M275550</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-06-21T19:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369285#M275552</link>
      <description>&lt;P&gt;It's not clear what you're asking here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please do not post the same question multiple times. I've merged them into one question now.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2017 19:11:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369285#M275552</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-21T19:11:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369300#M275553</link>
      <description>&lt;P&gt;I'm not entirely sure what you are asking, but if you want to add 21 days to todays date, then simply do&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
   todayplus21 = today() + 21;
   format todayplus21 date9.;
   put todayplus21;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="http://sasnrd.com/date-basics/" target="_blank"&gt;http://sasnrd.com/date-basics/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 13:27:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369300#M275553</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2017-09-18T13:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369337#M275554</link>
      <description>&lt;P&gt;Before adding 21 days, you should describe your input:&lt;/P&gt;
&lt;P&gt;what is the variable name that you want to add to it the 21 days? is it character or numeric type?&lt;/P&gt;
&lt;P&gt;if numeric - is it a sas date? if not, what format is it (ddmmyyyy or yymmdd or date9. etc.)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The answer to your question will change according to your answers to those questions.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2017 20:54:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369337#M275554</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2017-06-21T20:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369348#M275555</link>
      <description>Hi guys thanks so much for response what I need to do add 21 days as of today I didn't abt labels not being number so day of week would be good for example Today date id freq dos lot total thur Fri sat sun mon tues wed ....whst i want to add once that part been Id is the total amt base on freq for example&lt;BR /&gt;&lt;BR /&gt;Today date id. freq. total. thur Fri. sat. sun&lt;BR /&gt;06/21/17. A1 Fri sun. 150. 0. 150. 0. 150</description>
      <pubDate>Wed, 21 Jun 2017 21:57:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369348#M275555</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-06-21T21:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369356#M275556</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117620"&gt;@Gil_&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;To get good answers you need to provide sufficient information in your question.&lt;/P&gt;
&lt;P&gt;A very good way to provide such information is for you to post a SAS data step creating sample data and then you show us how your desired result should look like.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/31304"&gt;@PeterClemmensen&lt;/a&gt;&amp;nbsp;already posted sample code. Have you looked into it and understood what it does? May be that's already the solution for you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2017 22:18:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369356#M275556</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-06-21T22:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369361#M275557</link>
      <description>Sorry I didn't post my question 2x i rec error message 1st time so I hit post again that's why you see same question</description>
      <pubDate>Wed, 21 Jun 2017 22:42:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369361#M275557</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-06-21T22:42:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369362#M275558</link>
      <description>Thanks for code it only give one day I would need 21 days in day week (Mon Tue wed thur Fri sat sun) I will provide dataset</description>
      <pubDate>Wed, 21 Jun 2017 22:50:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369362#M275558</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-06-21T22:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369364#M275559</link>
      <description>&lt;P&gt;You need to create an array and then assign values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array days(21) days1-days21;

do i=1 to 21;
days(i) = i + date;
end;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Jun 2017 22:59:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/369364#M275559</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-06-21T22:59:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/370322#M275560</link>
      <description>Hi Reeza I try your example it didn't work should it be like a data set ?</description>
      <pubDate>Sun, 25 Jun 2017 00:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/370322#M275560</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-06-25T00:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/370324#M275561</link>
      <description>I realized I provided col not needed for my request.. I apologize Fri was a bad day ... Thank you for assistance here is how data looks and output needing&lt;BR /&gt;Dos. total. Mon. Tue. Wed thur. Fri Sat&lt;BR /&gt;Tue Fri. 125. 125. 125&lt;BR /&gt;&lt;BR /&gt;WED. 25. 25&lt;BR /&gt;&lt;BR /&gt;THANK YOU AGAIN FOR ASSISTANCE</description>
      <pubDate>Sun, 25 Jun 2017 01:11:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/370324#M275561</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-06-25T01:11:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/370325#M275562</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117620"&gt;@Gil_&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Statements like "it didn't work" without detailed explanation what you've done and what didn't work are not helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Provide a fully working data step creating sample data&lt;/P&gt;
&lt;P&gt;2. Explain what you want to do&lt;/P&gt;
&lt;P&gt;3. Provide the desired output to illustrate what you've explained in words how the outcome should look like (as a SAS data step as well or just a table which lists the results you would like to get)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once we understand what you have and what you need we can help you; else things will just go in circles waisting everbodys time.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 01:11:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/370325#M275562</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-06-25T01:11:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/370342#M275563</link>
      <description>I will admit i have never used arrays I Google for examples 1st before asking for assistance for some reason it flew over my head I use the array provide above&lt;BR /&gt;Data table;&lt;BR /&gt;Set table;&lt;BR /&gt;array days(21) days1-days21; do i=1 to 21; days(i) = i + date; end;&lt;BR /&gt;&lt;BR /&gt;The error i get is alphabetic prefixes for enumerated variable (days1-days21) are different. Too few variable define for the dimensions specified for the array day.&lt;BR /&gt;Undeclared array reference :days.&lt;BR /&gt;Syntax error, expecting one of the following : [ (&lt;BR /&gt;Syntax error statement will be ingored</description>
      <pubDate>Sun, 25 Jun 2017 04:49:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/370342#M275563</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-06-25T04:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/370343#M275564</link>
      <description>The data needs to look like this output&lt;BR /&gt;Dos._____ total._Mon__Tue__ Wed__ thur.__Fri__ Sat&lt;BR /&gt;Tue. Fri.___125.________125.______________125_____&lt;BR /&gt;&lt;BR /&gt;WED_______ 25________________25________________</description>
      <pubDate>Sun, 25 Jun 2017 04:56:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/370343#M275564</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-06-25T04:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/370359#M275565</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/117620"&gt;@Gil_&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Please provide fully working SAS data steps creating sample data!&lt;/P&gt;
&lt;P&gt;Post your desired result using insert code&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/9833iD5C813B69BAC4E80/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="Capture.JPG" title="Capture.JPG" /&gt;&amp;nbsp;so the layout doesn't get messed up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jun 2017 10:09:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/370359#M275565</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-06-25T10:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/370758#M275566</link>
      <description>Here is the table&lt;BR /&gt;Proc sql;&lt;BR /&gt;Create table want as&lt;BR /&gt;(Select&lt;BR /&gt;A.id,&lt;BR /&gt;A.dos,&lt;BR /&gt;A.total,&lt;BR /&gt;A2.date1,&lt;BR /&gt;A2.date2,&lt;BR /&gt;A2.date3,&lt;BR /&gt;A2.date4,&lt;BR /&gt;A2.date5&lt;BR /&gt;From table a, tablea2&lt;BR /&gt;Where a.id =a2.id&lt;BR /&gt;);&lt;BR /&gt;Run;&lt;BR /&gt;Id__dos___total_date1 ___date2_date3_date4_date5&lt;BR /&gt;&lt;BR /&gt;A1__Wed Sat_125._06/26_17_ 06/27/17 _06/28/17&lt;BR /&gt;For space I can add 3&lt;BR /&gt;What I want is this&lt;BR /&gt;&lt;BR /&gt;A1__Wed Sat_125._06/26_17_ 06/27/17 _125&lt;BR /&gt;&lt;BR /&gt;Dos has the date of week which I need to add the total where we match based on the day</description>
      <pubDate>Mon, 26 Jun 2017 21:08:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/370758#M275566</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-06-26T21:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to add 21 days</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/370759#M275567</link>
      <description>I was able to add the 21 days I just need to Id in the dos col based on date of week</description>
      <pubDate>Mon, 26 Jun 2017 21:15:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-21-days/m-p/370759#M275567</guid>
      <dc:creator>Gil_</dc:creator>
      <dc:date>2017-06-26T21:15:57Z</dc:date>
    </item>
  </channel>
</rss>

