<?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: Is there an equivalent of JMP Namespaces in SAS ? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-of-JMP-Namespaces-in-SAS/m-p/453053#M114413</link>
    <description>&lt;P&gt;Note that to test for a leap year, I would simply test if Feb 29th exists. Just a detail though.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;IS_LEAP_YEAR=(input(catt('29feb',YEAR),?? date9.)&amp;gt;.);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Apr 2018 03:47:31 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2018-04-11T03:47:31Z</dc:date>
    <item>
      <title>Is there an equivalent of JMP Namespaces in SAS ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-of-JMP-Namespaces-in-SAS/m-p/453042#M114404</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; I am a JMP user trying to learn SAS. One of the cool ways to manage user developed functions in JMP is namespaces.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Below is a sample namespace that I created in JMP. Now, in any JMP script, I can include this namespace and leverage the IsLeapYear function.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ExcelFunctions = New Namespace("Excel"); 
							 
// IsLeapYear
ExcelFunctions:IsLeapYear = function({Input_Year},{Default Local},
										// Inputs : 1. Input_Year - Integer that represents the year to test if leap or not 
										// Output : Returns 0 or 1 - 0 indicates not a leap year and 1 indicates that it is a leap year 
										If(Is String(Input_Year),
											Input_Year = Num(Input_Year);
										  );
										If( (Mod(Input_Year,400) == 0 | (Mod(Input_Year,4) == 0  &amp;amp; Mod(Input_Year,100)!= 0)),
											return(1);
											,
											return(0);
										  );
								   );// end of IsLeapYear Function 
					 &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Is there an equivalent of this in SAS ? Can anybody kindly illustrate with an example ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 03:15:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-of-JMP-Namespaces-in-SAS/m-p/453042#M114404</guid>
      <dc:creator>UdayGuntupalli</dc:creator>
      <dc:date>2018-04-11T03:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an equivalent of JMP Namespaces in SAS ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-of-JMP-Namespaces-in-SAS/m-p/453051#M114411</link>
      <description>&lt;P&gt;proc fcmp allows you to create custom functions in SAS.&lt;/P&gt;
&lt;P&gt;See if it fulfills your needs.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 03:41:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-of-JMP-Namespaces-in-SAS/m-p/453051#M114411</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-04-11T03:41:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an equivalent of JMP Namespaces in SAS ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-of-JMP-Namespaces-in-SAS/m-p/453053#M114413</link>
      <description>&lt;P&gt;Note that to test for a leap year, I would simply test if Feb 29th exists. Just a detail though.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;IS_LEAP_YEAR=(input(catt('29feb',YEAR),?? date9.)&amp;gt;.);&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 03:47:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-of-JMP-Namespaces-in-SAS/m-p/453053#M114413</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-04-11T03:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an equivalent of JMP Namespaces in SAS ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-of-JMP-Namespaces-in-SAS/m-p/453056#M114415</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Thank you for offering your guidance. If I understand your suggestion correctly, you are advising that I do something like this ?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;proc fcmp outlib = work.funcs.Test;
  function IsLeapYear(InputYear);
    If (Modz(Input_Year,400) = 0 | (Modz(Input_Year,4) = 0 &amp;amp; 
      Modz(Input_Year,100)^= 0)) Then
      Res = 1; 
    Else
      Res = 0; 
    Return(Res);
  endsub;
options cmplib = work.funcs.Test;

data _null_;
 TestYear = 2016; 
 Test = IsLeapYear(TestYear); 
  put Test = ;
run;&lt;/PRE&gt;&lt;P&gt;However, if I had 10 such user defined functions - by creating a namespace and "including" that namespace in my project, I get to use all of them while keeping my project clean. I am wondering if there is an equivalent for managing multiple functions like that in SAS ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, a question that has come up as I try to write the above is - work.funcs.trial is an example I used from the documentation, I wonder if I can rename that to a folder location&amp;nbsp; like say "C:\Users\Test" or something ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 04:11:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-of-JMP-Namespaces-in-SAS/m-p/453056#M114415</guid>
      <dc:creator>UdayGuntupalli</dc:creator>
      <dc:date>2018-04-11T04:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an equivalent of JMP Namespaces in SAS ?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-of-JMP-Namespaces-in-SAS/m-p/453062#M114420</link>
      <description>&lt;P&gt;You can have as many functions as you want and store them where you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
libname TEST 'c:\temp';

proc fcmp outlib = TEST.FUNC.NUM;
 function IsLeapYear(InputYear);
   return ( Modz(InputYear,400)=0 | (Modz(InputYear,4)=0 &amp;amp; Modz(InputYear,100)~=0) ) ;
 endsub;
 function IsEven(Integer);
   return ( Modz(Integer,2) = 0 ) ;
 endsub;
run;

options cmplib = TEST.FUNC;

data _null_;
   Res = IsLeapYear(2000);   put Res=;
   Res = IsLeapYear(2016);   put Res=;
   Res = IsLeapYear(2015);   put Res=;
   Res = IsEven(2016);       put Res=;
   Res = IsEven(2015);       put Res=;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Apr 2018 04:21:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-an-equivalent-of-JMP-Namespaces-in-SAS/m-p/453062#M114420</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-04-11T04:21:44Z</dc:date>
    </item>
  </channel>
</rss>

