<?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 PROC FCMP X PROC FORMAT and SAS Marketing Automation in SAS Customer Intelligence</title>
    <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/PROC-FCMP-X-PROC-FORMAT-and-SAS-Marketing-Automation/m-p/310722#M276</link>
    <description>&lt;P&gt;Hey experts!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know if anybody has already created any format based on a proc fcmp function and used it in SAS Marketing Automation or SAS Information Maps?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the help of some people here, the following code was created:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname funcs '/serverpath';


/**create function**/
proc fcmp outlib = funcs.functions.myfuncs;
function addZeros(x $) $;
res = catt(repeat('0', lengthm(x)-length(x)-1),x);
return (res);
endsub;
run;


options cmplib= funcs.functions;

libname formats = '/serverpath';

options fmtsearch = (formatos.formats);
&lt;BR /&gt;/**create new format***/
proc format library = formats;
value $addFormatTest other=[addZeros()];
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I try to test it in Information Map, I get the error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: The format AddFormatTest has a label that defines another format to be   loaded (named AddZeros), but this format could not be successfully   loaded (possibly for the same reason).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Even though deleting every function stored, I get the same error when I test it in Infomap.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In EG it works just fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 10 Nov 2016 17:27:14 GMT</pubDate>
    <dc:creator>bsas94</dc:creator>
    <dc:date>2016-11-10T17:27:14Z</dc:date>
    <item>
      <title>PROC FCMP X PROC FORMAT and SAS Marketing Automation</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/PROC-FCMP-X-PROC-FORMAT-and-SAS-Marketing-Automation/m-p/310722#M276</link>
      <description>&lt;P&gt;Hey experts!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know if anybody has already created any format based on a proc fcmp function and used it in SAS Marketing Automation or SAS Information Maps?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With the help of some people here, the following code was created:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname funcs '/serverpath';


/**create function**/
proc fcmp outlib = funcs.functions.myfuncs;
function addZeros(x $) $;
res = catt(repeat('0', lengthm(x)-length(x)-1),x);
return (res);
endsub;
run;


options cmplib= funcs.functions;

libname formats = '/serverpath';

options fmtsearch = (formatos.formats);
&lt;BR /&gt;/**create new format***/
proc format library = formats;
value $addFormatTest other=[addZeros()];
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When I try to test it in Information Map, I get the error:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ERROR: The format AddFormatTest has a label that defines another format to be   loaded (named AddZeros), but this format could not be successfully   loaded (possibly for the same reason).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Even though deleting every function stored, I get the same error when I test it in Infomap.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In EG it works just fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 17:27:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/PROC-FCMP-X-PROC-FORMAT-and-SAS-Marketing-Automation/m-p/310722#M276</guid>
      <dc:creator>bsas94</dc:creator>
      <dc:date>2016-11-10T17:27:14Z</dc:date>
    </item>
    <item>
      <title>Re: PROC FCMP X PROC FORMAT and SAS Marketing Automation</title>
      <link>https://communities.sas.com/t5/SAS-Customer-Intelligence/PROC-FCMP-X-PROC-FORMAT-and-SAS-Marketing-Automation/m-p/310737#M277</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We have resorted to FCMP+Format approach on several occasions with some of our customers, &amp;nbsp;I know for certain that it works in SAS MA.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm somewhat surprised that for a very simple use case like yours (lead zero padding), isn't there a proper built-in format in SAS, did you look well? Like Zx. (Z10.)?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But since as you say the this code-driven format already works for you in SAS EG but doesn't work through an Information Map, I would first check if "option cmplib" (and option fmtsearch) &amp;nbsp;is being executed within SAS Workspace Server and SAS Pooled Workspace Server context by default.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The proper way to make it happen would be in WorkspaceServer/autoexec_usermods.sas, PooledWorkspaceServer/autoexec_usermods.sas&amp;nbsp;and StoredProcessServer/autoexec_usermods.sas.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then restart an Object Spawner after the change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;WorkspaceServer is what is being used when you test the infomap&amp;nbsp;from SAS Information Studio, and I think it is also occasionally used by SAS MA (may depend on a version).&amp;nbsp;&lt;/SPAN&gt;PooledWorkspaceServer is normally used by SAS MA for most sql queries. &amp;nbsp;Depending on your use case, &amp;nbsp;you may also need it in the Stored Process Server context for SAS MA. &amp;nbsp;So I suggest to put it into all 3&amp;nbsp;autoexecs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If not for that, then maybe try to rename both a format and a function to shorter names, not to exceed 7-8 characters...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2016 18:45:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Customer-Intelligence/PROC-FCMP-X-PROC-FORMAT-and-SAS-Marketing-Automation/m-p/310737#M277</guid>
      <dc:creator>Dmitry_Alergant</dc:creator>
      <dc:date>2016-11-10T18:45:35Z</dc:date>
    </item>
  </channel>
</rss>

