<?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: function that returns a min date from table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873341#M345059</link>
    <description>&lt;P&gt;Thanks for your prompt respons&lt;/P&gt;
&lt;P&gt;I realize that my problem was not clearly defined; sorry for that.&lt;/P&gt;
&lt;P&gt;I have many dates in the input table;&amp;nbsp; this is my "have" table and "want" table; that's why I would like to create a function; thanks&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
Data T_TABLE_WANT ;
input input_date  ;
informat input_date ddmmyy10. ;
format input_date date9. ;
datalines ;
02/06/2023
07/06/2023
15/06/2023
23/06/2023
29/06/2023
;
run ;

Data T_TABLE_WANT ;
input input_date output_date ;
informat input_date output_date ddmmyy10. ;
format input_date output_date date9. ;
datalines ;
02/06/2023 03/06/2023
07/06/2023 08/06/2023
15/06/2023 16/06/2023
23/06/2023 24/06/2023
29/06/2023 30/06/2023
;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 02 May 2023 11:57:02 GMT</pubDate>
    <dc:creator>Nasser_DRMCP</dc:creator>
    <dc:date>2023-05-02T11:57:02Z</dc:date>
    <item>
      <title>function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873318#M345051</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I would like to create a function that returns the min date of a table wich is greater that an input date.&lt;/P&gt;
&lt;P&gt;for instance. with this table of june, if the input date is 23 june then the date returned should be 24 june. many thanks.&lt;/P&gt;
&lt;P&gt;Nasser&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
Data T_DATES ;
input day  ;
informat day ddmmyy10. ;
format day date9. ;
datalines ;
01/06/2023
02/06/2023
03/06/2023
04/06/2023
05/06/2023
06/06/2023
07/06/2023
08/06/2023
09/06/2023
10/06/2023
11/06/2023
12/06/2023
13/06/2023
14/06/2023
15/06/2023
16/06/2023
17/06/2023
18/06/2023
19/06/2023
20/06/2023
21/06/2023
22/06/2023
23/06/2023
24/06/2023
25/06/2023
26/06/2023
27/06/2023
28/06/2023
29/06/2023
30/06/2023
;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 09:28:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873318#M345051</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2023-05-02T09:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873319#M345052</link>
      <description>&lt;P&gt;How do you want the result? In a macro variable?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please be specific.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 09:35:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873319#M345052</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2023-05-02T09:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873322#M345053</link>
      <description>&lt;P&gt;not neccessary in a macro variable.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data T_TABLE1 ;
input input_date  ;
informat input_date ddmmyy10. ;
format input_date date9. ;
datalines ;
23/06/2023
;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the input date is in a table and I would lie to call the function like this:&lt;/P&gt;
&lt;P&gt;data T_TABLE2 ;&lt;/P&gt;
&lt;P&gt;set T_TABLE1 ;&lt;/P&gt;
&lt;P&gt;output_date = function(input_date,T_DATES) ;&lt;/P&gt;
&lt;P&gt;run ;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 09:51:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873322#M345053</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2023-05-02T09:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873323#M345054</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/147725"&gt;@Nasser_DRMCP&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I would like to create a function that returns the min date of a table wich is greater that an input date.&lt;/P&gt;
&lt;P&gt;for instance. with this table of june, if the input date is 23 june then the date returned should be 24 june. many thanks.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Okay, two steps: 1. find dates that are greater than 23 june; 2. find minimum of those dates&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data step1;
     set dates;
     if day&amp;gt;'23jun2023'd then output;
run;
proc summary data=step1;
    var day;
    output out=step2 min=min_day;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 May 2023 10:10:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873323#M345054</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-05-02T10:10:29Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873332#M345056</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/147725"&gt;@Nasser_DRMCP&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this, although it's not a function per-say, but it's done in a single data step&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data T_TABLE2(drop=rc) ;
	set T_TABLE1 ;
	rc = dosubl('proc sql outobs=1 noprint;
	select day into :next_day trimmed
	from (select day
		from t_dates
		where day &amp;gt;'|| input_date ||'); quit;');
	output_date = INPUT(symget('next_day'),date9.) ;
	format output_date date9.;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If a macro input_date were to be used, then this could work too&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let user_day = '23Jun2023'd;
proc sql outobs=1 noprint;
	select day
	into :next_day
	from (select day
		from t_dates
		where day &amp;gt; &amp;amp;user_day);
quit;
%put &amp;amp;=next_day;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 10:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873332#M345056</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2023-05-02T10:47:12Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873341#M345059</link>
      <description>&lt;P&gt;Thanks for your prompt respons&lt;/P&gt;
&lt;P&gt;I realize that my problem was not clearly defined; sorry for that.&lt;/P&gt;
&lt;P&gt;I have many dates in the input table;&amp;nbsp; this is my "have" table and "want" table; that's why I would like to create a function; thanks&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
Data T_TABLE_WANT ;
input input_date  ;
informat input_date ddmmyy10. ;
format input_date date9. ;
datalines ;
02/06/2023
07/06/2023
15/06/2023
23/06/2023
29/06/2023
;
run ;

Data T_TABLE_WANT ;
input input_date output_date ;
informat input_date output_date ddmmyy10. ;
format input_date output_date date9. ;
datalines ;
02/06/2023 03/06/2023
07/06/2023 08/06/2023
15/06/2023 16/06/2023
23/06/2023 24/06/2023
29/06/2023 30/06/2023
;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 11:57:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873341#M345059</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2023-05-02T11:57:02Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873344#M345061</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/147725"&gt;@Nasser_DRMCP&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BR /&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data T_TABLE_WANT ;
input input_date output_date ;
informat input_date output_date ddmmyy10. ;
format input_date output_date date9. ;
datalines ;
02/06/2023 03/06/2023
07/06/2023 08/06/2023
15/06/2023 16/06/2023
23/06/2023 24/06/2023
29/06/2023 30/06/2023
;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/147725"&gt;@Nasser_DRMCP&lt;/a&gt;&amp;nbsp;It looks like you want to add one day to the day to the value in INPUT_DATE. Is that what you want? This seems to contradict everything you have said so far.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 12:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873344#M345061</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-05-02T12:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873347#M345063</link>
      <description>&lt;P&gt;yes but only based on a list of days in a table; it is important because I have a table with all "working" days defined; and then, I want to get the first working date after a specifiq day that is contained in a "want" table.&lt;/P&gt;
&lt;P&gt;I am trying something like this&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc fcmp outlib=work.fonction.dates;
function next_working_day(p_date , p_table $ , p_colonne $); 

proc sql;
select min(p_colonne) into :nextdate
	from p_table
	where p_colonne &amp;gt; p_date
;

return(nextdate);
endsub;
run; quit; 


Data T_TABLE_WANT ;
set T_TABLE_HAVE ;
output_date = next_working_day(input_date);
run ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 May 2023 12:13:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873347#M345063</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2023-05-02T12:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873348#M345064</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I want to get the first working date after a specifiq day that is contained in a "HAVE" (not "want") table.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 12:14:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873348#M345064</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2023-05-02T12:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873350#M345066</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/147725"&gt;@Nasser_DRMCP&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;yes but only based on a list of days in a table;&amp;nbsp;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I really don't know what you mean by this. Discussions that have "yes but ..." are by definition unclear. You just showed us an example where you have a data set&amp;nbsp;T_TABLE_WANT, and the desired output is to shown which is one day greater than the day in the original table, there's no additional table with a list of days. Then you say&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;it is important because I have a table with all "working" days defined;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If we are going to help you write code that works, we need to see this table as well.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Can you please give us a complete and clear problem description, with portions of all necessary tables?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 12:18:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873350#M345066</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-05-02T12:18:19Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873354#M345068</link>
      <description>&lt;P&gt;OK.I try to be clear. with july it should be clearer;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in input I have 2 tables; T_WORKING_DAYS and T_HAVE;&lt;/P&gt;
&lt;P&gt;note that 14 is missing in T_WORKING_DAYS because is not a working day&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
Data T_WORKING_DAYS ;
input day  ;
informat day ddmmyy10. ;
format day date9. ;
datalines ;
01/07/2023
02/07/2023
03/07/2023
04/07/2023
05/07/2023
06/07/2023
07/07/2023
08/07/2023
09/07/2023
10/07/2023
11/07/2023
12/07/2023
13/07/2023
15/07/2023
16/07/2023
17/07/2023
18/07/2023
19/07/2023
20/07/2023
21/07/2023
22/07/2023
23/07/2023
24/07/2023
25/07/2023
26/07/2023
27/07/2023
28/07/2023
29/07/2023
30/07/2023
31/07/2023
;
run ;

Data T_HAVE ;
input input_date  ;
informat input_date ddmmyy10. ;
format input_date date9. ;
datalines ;
13/07/2023
23/07/2023
29/07/2023
;
run ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;I would like to get a T_WANT_TABLE that contains 2 columns. "input_date" column coming from&amp;nbsp;T_HAVE table. and "output_date" column would be the first date (the smallest) after the input_date. for examle, by applying the function to first row, where the input_date is 13/07/2023; the function woud return 15/07/2023 because 15/07 is the first day among dates in&amp;nbsp;&lt;CODE class=" language-sas"&gt;T_WORKING_DAYS&amp;nbsp;that&amp;nbsp;is&amp;nbsp;greater&amp;nbsp;than 13&amp;nbsp;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 12:41:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873354#M345068</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2023-05-02T12:41:52Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873358#M345070</link>
      <description>&lt;P&gt;Do you really need a function?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This feels like a SQL join.&amp;nbsp; Correlated subqueries definitely aren't my specialty, but after hacking around I came up with:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql ;
  select 
    input_date 
   ,(select min(day) as day 
    from T_WORKING_DAYS as b
    where b.day&amp;gt;a.input_date
    ) as want_date format=date9.
  from T_HAVE as a
  ;
quit ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm sure there are better SQL solutions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you really want a function, since you're dealing with calendar dates over a limited time span, you could also just make a table that maps every date to the next business date.&amp;nbsp; And use that table to create a format, nextbusinessday, then use the PUT function to look up a value.&amp;nbsp; Or whatever table lookup method you like.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 13:03:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873358#M345070</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-05-02T13:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873359#M345071</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/147725"&gt;@Nasser_DRMCP&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This step gives you the desired output&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data T_WANT(drop=rc) ;
	set T_HAVE ;
	rc = dosubl('proc sql outobs=1 noprint;
	select day into :next_day trimmed
	from (select day
		from t_working_days
		where day &amp;gt;'|| input_date ||'); quit;');
	output_date = INPUT(symget('next_day'),date9.) ;
	format output_date date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 13:03:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873359#M345071</guid>
      <dc:creator>AhmedAl_Attar</dc:creator>
      <dc:date>2023-05-02T13:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873360#M345072</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/147725"&gt;@Nasser_DRMCP&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can specify &lt;A href="https://documentation.sas.com/doc/en/lrcon/9.4/p0g056g35ez8son1sfavozh0lfb3.htm#n1fp94mw55w5ian142gw4ybhs2zj" target="_blank" rel="noopener"&gt;custom intervals&lt;/A&gt; for the INTNX function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data wd;
set T_Working_Days(rename=(day=begin));
run;

options intervalds=(WorkingDays=wd);

data t_want;
set t_have;
output_date=intnx('WorkingDays',input_date,1);
format output_date date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 02 May 2023 13:14:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873360#M345072</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-05-02T13:14:13Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873366#M345075</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/147725"&gt;@Nasser_DRMCP&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can specify &lt;A href="https://documentation.sas.com/doc/en/lrcon/9.4/p0g056g35ez8son1sfavozh0lfb3.htm#n1fp94mw55w5ian142gw4ybhs2zj" target="_blank" rel="noopener"&gt;custom intervals&lt;/A&gt; for the INTNX function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data wd;
set T_Working_Days(rename=(day=begin));
run;

options intervalds=(WorkingDays=wd);

data t_want;
set t_have;
output_date=intnx('WorkingDays',input_date,1);
format output_date date9.;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I think we have a winner.&amp;nbsp; Wow,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;, thanks for sharing that.&amp;nbsp; If I can discover one new (to me) approach like that a year, my time on communities will be worth it. : )&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 13:27:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873366#M345075</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-05-02T13:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873372#M345081</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;If I can discover one new (to me) approach like that a year, my time on communities will be worth it. : )&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Thanks. Same here. :&lt;FONT face="helvetica"&gt;-&lt;/FONT&gt;) I think I learned that approach in 2018 from &lt;A href="https://communities.sas.com/t5/SAS-Programming/re-Expand-Records/m-p/502864/highlight/true#M134293" target="_blank" rel="noopener"&gt;this post&lt;/A&gt; by John King.&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 14:03:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873372#M345081</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-05-02T14:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873392#M345091</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/147725"&gt;@Nasser_DRMCP&lt;/a&gt;&amp;nbsp;, I suggest you un-accept my answer as the solution, and then select&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733"&gt;@FreelanceReinh&lt;/a&gt;&amp;nbsp;'s custom interval answer as the solution.&amp;nbsp; My answer was just to celebrate the cool solution.&amp;nbsp; I didn't feel like a simple "like" was enough.&amp;nbsp; : )&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 15:03:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873392#M345091</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-05-02T15:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873402#M345093</link>
      <description>&lt;P&gt;Quentin,&lt;/P&gt;
&lt;P&gt;I agree with you to accept the &lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32733" target="_blank"&gt;FreelanceReinh&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;'s&amp;nbsp;&lt;/SPAN&gt;solution; but I don't know how t un-accept yours&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 15:19:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873402#M345093</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2023-05-02T15:19:53Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873411#M345099</link>
      <description>&lt;P&gt;I think if you click a button near my solution, there should be an option to select "this is not the solution" or something like that.&amp;nbsp; Or if you can't do it, it's possible one of the admins or super-users will do it. They have special powers. : )&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 15:41:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873411#M345099</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-05-02T15:41:23Z</dc:date>
    </item>
    <item>
      <title>Re: function that returns a min date from table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873423#M345104</link>
      <description>&lt;P&gt;it s done !&lt;/P&gt;
&lt;P&gt;thank for your help&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 16:12:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/function-that-returns-a-min-date-from-table/m-p/873423#M345104</guid>
      <dc:creator>Nasser_DRMCP</dc:creator>
      <dc:date>2023-05-02T16:12:51Z</dc:date>
    </item>
  </channel>
</rss>

