<?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 trading days quickly? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643184#M191915</link>
    <description>&lt;P&gt;That is what I did. the TRADINGDAYS dataset has 1 column that contains only trading days. My code works as follows: it goes to each obs in the MAIN dataset (call this event day) and create 10 trading days before and 100 trading days after by going through the TRADINGDAYS dataset, and this is why it is so slow. this process also gives me is a T variable that tells how many trading days away from my event day. I don't know how to improve it&lt;/P&gt;</description>
    <pubDate>Mon, 27 Apr 2020 03:13:02 GMT</pubDate>
    <dc:creator>somebody</dc:creator>
    <dc:date>2020-04-27T03:13:02Z</dc:date>
    <item>
      <title>How to add trading days quickly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643162#M191903</link>
      <description>&lt;P&gt;I am doing an event study. I have a dataset containing trading days and the main dataset. The following code adds 10 trading days before and 100 days after&amp;nbsp;each day in the main dataset. However, it is very slow. Is there another way to achieve the same task or How can I improve efficiency?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data tradingdays; set wrds.tradingdays;run;
	options intervalds=(tradingdays=tradingdays);
	proc sort data=main_sample;by stock date;run;
	data main_sample(rename=(date=date_t0 date2=date)); 
		set main_sample;
		by stock date;
		if first.date;
		format date2 YYMMDD10.;
		do t=-10 to 100; date2=intnx('tradingdays',date,t)  ;output; end;
	run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Edit: Added a sample of the datasets.&lt;BR /&gt;An example of my main data looks like this:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;stock&lt;/TD&gt;&lt;TD&gt;date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;20190123&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;TD&gt;20181110&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CCC&lt;/TD&gt;&lt;TD&gt;20100701&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;What I would like to achieve is something like this:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;stock&lt;/TD&gt;&lt;TD&gt;date_t0&lt;/TD&gt;&lt;TD&gt;date&lt;/TD&gt;&lt;TD&gt;t&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;20190123&lt;/TD&gt;&lt;TD&gt;20190117&lt;/TD&gt;&lt;TD&gt;-3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;20190123&lt;/TD&gt;&lt;TD&gt;20190118&lt;/TD&gt;&lt;TD&gt;-2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;20190123&lt;/TD&gt;&lt;TD&gt;20190122&lt;/TD&gt;&lt;TD&gt;-1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;20190123&lt;/TD&gt;&lt;TD&gt;20190123&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;20190123&lt;/TD&gt;&lt;TD&gt;20190124&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;20190123&lt;/TD&gt;&lt;TD&gt;20190125&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AAA&lt;/TD&gt;&lt;TD&gt;20190123&lt;/TD&gt;&lt;TD&gt;20190128&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;TD&gt;20181109&lt;/TD&gt;&lt;TD&gt;20181106&lt;/TD&gt;&lt;TD&gt;-3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;TD&gt;20181109&lt;/TD&gt;&lt;TD&gt;20181107&lt;/TD&gt;&lt;TD&gt;-2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;TD&gt;20181109&lt;/TD&gt;&lt;TD&gt;20181108&lt;/TD&gt;&lt;TD&gt;-1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;TD&gt;20181109&lt;/TD&gt;&lt;TD&gt;20181109&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;TD&gt;20181109&lt;/TD&gt;&lt;TD&gt;20181112&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;TD&gt;20181109&lt;/TD&gt;&lt;TD&gt;20181113&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BBB&lt;/TD&gt;&lt;TD&gt;20181109&lt;/TD&gt;&lt;TD&gt;20181114&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CCC&lt;/TD&gt;&lt;TD&gt;20100701&lt;/TD&gt;&lt;TD&gt;20100628&lt;/TD&gt;&lt;TD&gt;-3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CCC&lt;/TD&gt;&lt;TD&gt;20100701&lt;/TD&gt;&lt;TD&gt;20100629&lt;/TD&gt;&lt;TD&gt;-2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CCC&lt;/TD&gt;&lt;TD&gt;20100701&lt;/TD&gt;&lt;TD&gt;20100630&lt;/TD&gt;&lt;TD&gt;-1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CCC&lt;/TD&gt;&lt;TD&gt;20100701&lt;/TD&gt;&lt;TD&gt;20100701&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CCC&lt;/TD&gt;&lt;TD&gt;20100701&lt;/TD&gt;&lt;TD&gt;20100702&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CCC&lt;/TD&gt;&lt;TD&gt;20100701&lt;/TD&gt;&lt;TD&gt;20100705&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CCC&lt;/TD&gt;&lt;TD&gt;20100701&lt;/TD&gt;&lt;TD&gt;20100706&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 27 Apr 2020 10:54:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643162#M191903</guid>
      <dc:creator>somebody</dc:creator>
      <dc:date>2020-04-27T10:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to add trading days quickly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643169#M191907</link>
      <description>&lt;P&gt;Hi &lt;A class="trigger-hovercard" style="color: #007dc3;" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/98381" target="_blank"&gt;ducman1611&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;I don't think your code does what you describe it should do. To do what you describe, you need much simpler code, such as this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options intervalds=(tradingdays=wrds.tradingdays);

data main_sample; 
   set main_sample;
   date_10_before = intnx('tradingdays',date,-10);
   date_100_after = intnx('tradingdays',date,100);
   format date_10_before date_100_after YYMMDD10.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 01:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643169#M191907</guid>
      <dc:creator>LeonidBatkhan</dc:creator>
      <dc:date>2020-04-27T01:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to add trading days quickly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643171#M191908</link>
      <description>&lt;P&gt;Hi, I think your code only create 2 extra variables with the before and after dates. What I aim to achieve is to create new observations before and after the dates from the main_sample dataset&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 01:55:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643171#M191908</guid>
      <dc:creator>somebody</dc:creator>
      <dc:date>2020-04-27T01:55:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to add trading days quickly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643175#M191911</link>
      <description>&lt;P&gt;How slow is your program? It would help if you posted your SAS log including notes showing how long it took and how many rows. If you are creating 110 rows for every input row and if you have a large number of input rows then that is going to take time regardless.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 02:41:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643175#M191911</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-04-27T02:41:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to add trading days quickly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643178#M191912</link>
      <description>&lt;P&gt;It has not finished running. I used the same code with "weekdays" and it finished after 20 seconds. When I replace it with my "tradingdays", it will probably take 20 hours&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 02:50:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643178#M191912</guid>
      <dc:creator>somebody</dc:creator>
      <dc:date>2020-04-27T02:50:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to add trading days quickly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643182#M191914</link>
      <description>&lt;P&gt;OK, so using INTERVALDS is slow. Perhaps you could re-engineer your program to generate all possible trading days only once into an intermediate dataset, then use that to build your final dataset. You could do this by getting the minimum and maximum dates from your main sample.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 03:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643182#M191914</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-04-27T03:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to add trading days quickly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643184#M191915</link>
      <description>&lt;P&gt;That is what I did. the TRADINGDAYS dataset has 1 column that contains only trading days. My code works as follows: it goes to each obs in the MAIN dataset (call this event day) and create 10 trading days before and 100 trading days after by going through the TRADINGDAYS dataset, and this is why it is so slow. this process also gives me is a T variable that tells how many trading days away from my event day. I don't know how to improve it&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 03:13:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643184#M191915</guid>
      <dc:creator>somebody</dc:creator>
      <dc:date>2020-04-27T03:13:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to add trading days quickly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643197#M191921</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/98381"&gt;@somebody&lt;/a&gt;&amp;nbsp; - If I understand your program correctly you are repeating your trading day calculation for each of your stocks. If you calculate the minimum and maximum days across all of your stocks you only need to do the trading days calculation once.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If would help if you posted some sample data so we can understand your problem better.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 05:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643197#M191921</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-04-27T05:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to add trading days quickly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643199#M191922</link>
      <description>&lt;P&gt;Please enable option fullstimer to display&amp;nbsp; more information in the log and then post the full log.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 05:45:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643199#M191922</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2020-04-27T05:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to add trading days quickly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643240#M191940</link>
      <description>&lt;P&gt;I edited the post, adding an example&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 10:55:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643240#M191940</guid>
      <dc:creator>somebody</dc:creator>
      <dc:date>2020-04-27T10:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to add trading days quickly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643295#M191964</link>
      <description>&lt;P&gt;Hi &lt;A class="trigger-hovercard" style="color: #007dc3;" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/98381" target="_blank"&gt;ducman1611&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;I recently wrote a blog post that solves the problem such as yours. Take a look at &lt;A href="https://blogs.sas.com/content/sgf/2020/01/27/shifting-a-date-by-a-given-number-of-workdays/" target="_self"&gt;Shifting a date by a given number of workdays&lt;/A&gt;. Workdays are your trading days.&lt;/P&gt;
&lt;P&gt;I used slightly different technique there, using SAS user-defined formats dynamically built from the calendar table.&lt;/P&gt;
&lt;P&gt;There is also a discussion at the end of that post regarding using custom time intervals (you need your calendar table prepared in a certain way - to have BEGIN variable and format assigned), there is also a code example there.&lt;/P&gt;
&lt;P&gt;Please take a look.&lt;/P&gt;
&lt;P&gt;Best,&lt;/P&gt;
&lt;P&gt;Leonid&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 14:03:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643295#M191964</guid>
      <dc:creator>LeonidBatkhan</dc:creator>
      <dc:date>2020-04-27T14:03:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to add trading days quickly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643406#M192010</link>
      <description>&lt;P&gt;I'm going to strike out this entire comment.&amp;nbsp; I see that you are treating every date in your sample as an event date.&amp;nbsp; So you will be producing a dataset 121 times the size of your original sample.&amp;nbsp; Is that your intention?&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;
&lt;P&gt;&lt;STRIKE&gt;Let's say wrds.tradingdays has one obs per trading day, with variable name TRDATE, then this can produce what you describe:&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;STRIKE&gt;&lt;CODE class=" language-sas"&gt; data want (drop=d d0 trdate);
   array trdates {2000} _temporary_;

   if _n_=1 then do d=1 by 1 until (end_of_trcalendar);
     set wrds.tradingdays (keep=trdate) end=end_of_trcalendar;
     trdates{d}=trdate;
   end;

   set main.sample;
   by stock date;

   if first.date;
   date_t0=date;
   d0=whichn(date_t0,of trdates{*});

   do T=-10 to 100;
     date=trdates{d0+t};
     output;
   end;
run;
&lt;/CODE&gt;&lt;/STRIKE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRIKE&gt;The technique here is to make an array of trading dates (TRDATES above).&amp;nbsp; So if the event date matches the date in&amp;nbsp; the 20th element of the (i.e. event date =TRDATES{20}) then all you have to do is loop from TRDATES{10} through TRDATES{120}.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;The only "slow" part of this is the WHICHN function which matches your event date serially through the array.&amp;nbsp; But you're only doing it once per event, so the cost may not be high.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRIKE&gt;But beware - in the above, the event date must be a trading date.&lt;/STRIKE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2020 19:45:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/643406#M192010</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-04-27T19:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to add trading days quickly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/644164#M192366</link>
      <description>&lt;P&gt;I tried your code and get an error:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: Array subscript out of range at line 444 column 13.
d=2001 end_of_trcalendar=0 trdate=19320917 PERMNO=. DATE=. FIRST.PERMNO=1 LAST.PERMNO=1 FIRST.DATE=1
LAST.DATE=1 date_t0=. d0=. T=. _ERROR_=1 _N_=1
NOTE: The SAS System stopped processing this step because of errors.
NOTE: There were 2002 observations read from the data set WORK.TRADINGDAYS.
NOTE: There were 1 observations read from the data set WORK.TEST.
WARNING: The data set WORK.WANT may be incomplete.  When this step was stopped there were 0
         observations and 4 variables.
WARNING: Data set WORK.WANT was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;how do I fix this? btw, why did you cross out your comment?&lt;/P&gt;</description>
      <pubDate>Thu, 30 Apr 2020 07:19:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/644164#M192366</guid>
      <dc:creator>somebody</dc:creator>
      <dc:date>2020-04-30T07:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to add trading days quickly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/644627#M192569</link>
      <description>&lt;P&gt;Why do you have&amp;nbsp;&amp;nbsp; "if first.date" in your program? Does this mean you have a given permno/date combination repeated in main.sample? This is what gave rise to my striking out the program.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And notice the sas log reports date=.&amp;nbsp;&amp;nbsp; That is the source of this particular problem, since the program assumes you have valid DATE values in main.sample. You'll have to make sure you only have valid date values.&lt;/P&gt;</description>
      <pubDate>Fri, 01 May 2020 22:31:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/644627#M192569</guid>
      <dc:creator>mkeintz</dc:creator>
      <dc:date>2020-05-01T22:31:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to add trading days quickly?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/649799#M194846</link>
      <description>&lt;P&gt;even i made sure the variable date has a valid value, the error is still returned. I notice that if I change the number in "array trdates {2000}" to {20000}, it solves the issue. Do you have any idea why this is the case?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 May 2020 08:27:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-add-trading-days-quickly/m-p/649799#M194846</guid>
      <dc:creator>somebody</dc:creator>
      <dc:date>2020-05-22T08:27:23Z</dc:date>
    </item>
  </channel>
</rss>

