<?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 a SASFUNC function similar to SASNAME/NVALID? If not, how could it be implemented in FC in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-SASFUNC-function-similar-to-SASNAME-NVALID-If-not-how/m-p/961750#M374911</link>
    <description>&lt;P&gt;You need to be clearer what you are asking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The NAME of a function is&amp;nbsp; a name that follows the original SAS naming rules.&amp;nbsp; So if you want to test if a string's value is following those rules it is the same whether the name is to used for function or dataset or a variable.&amp;nbsp; In that case use the NVALID() function with the optional second argument set to V7.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let name=Fred;
%put valid_name =%sysfunc(nvalid(&amp;amp;name,v7));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I think perhaps you are asking for something much different.&amp;nbsp; Are you asking to know if there is a LIST of existing SAS defined functions? If that is your question I do not think such a list is available as part of SAS.&lt;/P&gt;
&lt;P&gt;Or are you asking if there is a way to query a catalog you used with PROC FCMP to store some user defined functions?&amp;nbsp; That might be possible using SASHELP.VCATALG or other dictionary views.&amp;nbsp; Or perhaps using PROC CATALOG.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Mar 2025 02:51:47 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2025-03-13T02:51:47Z</dc:date>
    <item>
      <title>Is there a SASFUNC function similar to SASNAME/NVALID? If not, how could it be implemented in FCMP?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-SASFUNC-function-similar-to-SASNAME-NVALID-If-not-how/m-p/961747#M374910</link>
      <description>&lt;P&gt;SASNAME will tell you if a name is a valid SASNAME&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;rc=SASNAME(name);&lt;/P&gt;
&lt;P class="lia-indent-padding-left-30px"&gt;return code for the operation:&lt;/P&gt;
&lt;TABLE class=" lia-indent-margin-left-30px"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="xis-value"&gt;1&lt;/TD&gt;
&lt;TD&gt;The name is a valid SAS name.&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="xis-value"&gt;0&lt;/TD&gt;
&lt;TD&gt;The name is not a valid SAS name.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there an equivalent SASFUNC(name) that will tell you if &lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;name is a valid function name&lt;/STRONG&gt;&lt;/FONT&gt; in the current session?&lt;/P&gt;
&lt;P&gt;If not and it was custom coded in FCMP is there a place to lookup available functions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 02:51:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-SASFUNC-function-similar-to-SASNAME-NVALID-If-not-how/m-p/961747#M374910</guid>
      <dc:creator>RichardAD</dc:creator>
      <dc:date>2025-03-13T02:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a SASFUNC function similar to SASNAME/NVALID? If not, how could it be implemented in FC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-SASFUNC-function-similar-to-SASNAME-NVALID-If-not-how/m-p/961750#M374911</link>
      <description>&lt;P&gt;You need to be clearer what you are asking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The NAME of a function is&amp;nbsp; a name that follows the original SAS naming rules.&amp;nbsp; So if you want to test if a string's value is following those rules it is the same whether the name is to used for function or dataset or a variable.&amp;nbsp; In that case use the NVALID() function with the optional second argument set to V7.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let name=Fred;
%put valid_name =%sysfunc(nvalid(&amp;amp;name,v7));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;But I think perhaps you are asking for something much different.&amp;nbsp; Are you asking to know if there is a LIST of existing SAS defined functions? If that is your question I do not think such a list is available as part of SAS.&lt;/P&gt;
&lt;P&gt;Or are you asking if there is a way to query a catalog you used with PROC FCMP to store some user defined functions?&amp;nbsp; That might be possible using SASHELP.VCATALG or other dictionary views.&amp;nbsp; Or perhaps using PROC CATALOG.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 02:51:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-SASFUNC-function-similar-to-SASNAME-NVALID-If-not-how/m-p/961750#M374911</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-03-13T02:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a SASFUNC function similar to SASNAME/NVALID? If not, how could it be implemented in FC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-SASFUNC-function-similar-to-SASNAME-NVALID-If-not-how/m-p/961751#M374912</link>
      <description>&lt;P&gt;Correct, much different. Would like to test if name is the name of a function within context of session (i.e. installed products and fcmp cmplib)&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 02:59:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-SASFUNC-function-similar-to-SASNAME-NVALID-If-not-how/m-p/961751#M374912</guid>
      <dc:creator>RichardAD</dc:creator>
      <dc:date>2025-03-13T02:59:56Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a SASFUNC function similar to SASNAME/NVALID? If not, how could it be implemented in FC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-SASFUNC-function-similar-to-SASNAME-NVALID-If-not-how/m-p/961806#M374934</link>
      <description>&lt;P&gt;As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;has already stated, I don't think there is such a SAS function for checking all available functions nor any way of implementing such a check yourself in FCMP. Why do you want such functionality?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2025 19:07:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-SASFUNC-function-similar-to-SASNAME-NVALID-If-not-how/m-p/961806#M374934</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2025-03-13T19:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Is there a SASFUNC function similar to SASNAME/NVALID? If not, how could it be implemented in FC</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-there-a-SASFUNC-function-similar-to-SASNAME-NVALID-If-not-how/m-p/961814#M374937</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/300781"&gt;@RichardAD&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you can retrieve the names of SAS-supplied functions (and CALL routines) from DICTIONARY.FUNCTIONS and then add the names of user-defined functions (and, optionally, subroutines, see 'SUBROUTI' below) from the CMPLIB:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
create table fncnames as

select fncname
from dictionary.functions
where fncname ne ' '

union

select scan(_key_,-1,'.')
from %sysfunc(getoption(cmplib))
where name in ('FUNCTION' 'SUBROUTI')
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While it should be possible to load this dataset into a PROC FCMP array or hash object, you could also create a numeric informat&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data infmt;
retain fmtname 'isfncname' type 'I' label 1 hlo 'U';
set fncnames(rename=(fncname=start)) end=last;
output;
if last then do;
  hlo='O';
  label=0;
  output;
end;
run;

proc format cntlin=infmt;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and then use the INPUT function to obtain the 1/0 flag for existing/non-existing function names:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
input name :$20.;
fnflag=input(name,isfncname.);
cards;
cos
propcase
baseconvfp
other
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;In my SAS session there is a user-defined function &lt;A href="https://communities.sas.com/t5/SAS-Programming/Converting-a-19-length-number-to-hex-and-then-to-a-string/m-p/654626/highlight/true#M196566" target="_blank" rel="noopener"&gt;BASECONVFP&lt;/A&gt;, but there is no function named "OTHER", so the result is this:&lt;/P&gt;
&lt;PRE&gt;Obs    name          fnflag

 1     cos              1
 2     propcase         1
 3     baseconvfp       1
 4     other            0
&lt;/PRE&gt;</description>
      <pubDate>Thu, 13 Mar 2025 20:54:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-there-a-SASFUNC-function-similar-to-SASNAME-NVALID-If-not-how/m-p/961814#M374937</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2025-03-13T20:54:32Z</dc:date>
    </item>
  </channel>
</rss>

