<?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: Using data step functions in DS2? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Using-data-step-functions-in-DS2/m-p/478912#M71423</link>
    <description>Unfortunately, using the resolve function inside the run method causes a compilation failure due to unknown function 'resolve'... Can't seem to find much with this regard either. Going to look into it some more in the meantime, thanks!</description>
    <pubDate>Wed, 18 Jul 2018 05:04:32 GMT</pubDate>
    <dc:creator>DTFX-JJ</dc:creator>
    <dc:date>2018-07-18T05:04:32Z</dc:date>
    <item>
      <title>Using data step functions in DS2?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-data-step-functions-in-DS2/m-p/478695#M71401</link>
      <description>I'm trying to do some comparisons (for personal preference) between using a data step and proc DS2 for certain tasks.&lt;BR /&gt;&lt;BR /&gt;The problem is that i've hit the snag of not having compged/complev/soundex functions available from within the run method.&lt;BR /&gt;&lt;BR /&gt;Is there any way to access these functions from within Proc DS2? Or alternatively from proc FCMP?&lt;BR /&gt;&lt;BR /&gt;I've gone through the language guides and i can't seem to find anything relevant.&lt;BR /&gt;&lt;BR /&gt;Help is much appreciated.</description>
      <pubDate>Tue, 17 Jul 2018 15:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-data-step-functions-in-DS2/m-p/478695#M71401</guid>
      <dc:creator>DTFX-JJ</dc:creator>
      <dc:date>2018-07-17T15:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using data step functions in DS2?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-data-step-functions-in-DS2/m-p/478873#M71418</link>
      <description>&lt;P&gt;That's a very good question. I've tried to create an FCMP function and then a DS2 FCMP package using that function and while the original function works fine in Base SAS it fails when called through the DS2 FCMP function with an error :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: Cannot find a library containing subroutine SOUNDEX.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This leads me to believe that functions not supported in DS2 can't be called even when wrapped inside an FCMP function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the record here's my code complete with tests&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc fcmp outlib=work.funcs;
	function mysoundex(name $) $;
	length retval $4;
	put name=;
	retval=soundex(name);
	put retval=;
		return(retval);
	endsub;
run;

options cmplib=work.funcs;

data _null_;
	length rc $4;

	set sashelp.class;
	rc=mysoundex(name);
	put rc=;
run;

proc ds2;
	package sndx / overwrite=yes
	language='fcmp'
	table='work.funcs';
run;
quit;


data class;
	set sashelp.class;
run;

proc ds2;
	data _null_;
	dcl package sndx myval();
	dcl char(4) retval;
	method run();
		set class;
		retval=myval.mysoundex(name);
		put retval=;
	end;

run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I would encourage you to log a support track with SAS which you can do here -&amp;gt; &lt;A href="https://support.sas.com/ctx/supportform/createForm" target="_blank"&gt;https://support.sas.com/ctx/supportform/createForm&lt;/A&gt; in case they have any suggestions...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 00:15:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-data-step-functions-in-DS2/m-p/478873#M71418</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2018-07-18T00:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: Using data step functions in DS2?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-data-step-functions-in-DS2/m-p/478892#M71420</link>
      <description>&lt;P&gt;I don't know about the other functions on your list but why not trying use SAS macro processor to handle your need for the SOUNDEX() function.&lt;/P&gt;
&lt;P&gt;See if you can translate this simple datastep into PROC DS2 step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test ;
  set sashelp.class ;
  x1 = soundex(name);
  x2 = resolve('%sysfunc(soundex('||name||'))');
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 18 Jul 2018 02:42:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-data-step-functions-in-DS2/m-p/478892#M71420</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-07-18T02:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Using data step functions in DS2?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Using-data-step-functions-in-DS2/m-p/478912#M71423</link>
      <description>Unfortunately, using the resolve function inside the run method causes a compilation failure due to unknown function 'resolve'... Can't seem to find much with this regard either. Going to look into it some more in the meantime, thanks!</description>
      <pubDate>Wed, 18 Jul 2018 05:04:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Using-data-step-functions-in-DS2/m-p/478912#M71423</guid>
      <dc:creator>DTFX-JJ</dc:creator>
      <dc:date>2018-07-18T05:04:32Z</dc:date>
    </item>
  </channel>
</rss>

