<?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: HELLO! I have a technical problem that needs to be solved urgently in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/HELLO-I-have-a-technical-problem-that-needs-to-be-solved/m-p/870885#M344019</link>
    <description>sorry,I didn't pay attention to the content of the answer，thank you very much！</description>
    <pubDate>Thu, 20 Apr 2023 20:15:43 GMT</pubDate>
    <dc:creator>_Sas_Beginner_</dc:creator>
    <dc:date>2023-04-20T20:15:43Z</dc:date>
    <item>
      <title>HELLO! I have a technical problem that needs to be solved urgently</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELLO-I-have-a-technical-problem-that-needs-to-be-solved/m-p/870746#M343936</link>
      <description>各位专家您好，我有一个技术问题亟待解决，如果可以通过 fcmp 函数中的“run_macro”语句调用宏语句，并且在数据程序步骤中调用 PROC 过程步骤，但是 fcmp 函数在 proc ds2 中无法使用，则会提示无法识别“run_macro”的错误消息， 如何解决这个问题？&lt;PRE&gt;&lt;CODE class=""&gt;/*Runs successfully*/
%macro distinct_values;

%let input_table = %sysfunc(dequote(&amp;amp;input_table));

%let column = %sysfunc(dequote(&amp;amp;column));

%let output_table = %sysfunc(dequote(&amp;amp;output_table));

proc sql;

create table &amp;amp;output_table as

select distinct &amp;amp;column

from &amp;amp;input_table;

%mend;

proc fcmp outlib=work.funcs.sql;

function get_distinct_values(input_table $, column $, output_table $);

rc = run_macro('distinct_values', input_table, column, output_table);

return (rc);

endsub;
run;
data _null_;

rc = get_distinct_values('sashelp.shoes', 'region', 'work.regions');

id=open('work.regions');

if id then nobs=attrn(id,'NOBS');

put nobs;

run;

/*If you use proc DS2 instead of the data step, the run fails*/
PROC DS2 ;
PACKAGE FUNCTION_PACK / OVERWRITE=YES LANGUAGE='FCMP' TABLE='WORK.FUNCS';
ENDPACKAGE;
RUN;
QUIT;
PROC DS2;
DCL PACKAGE FUNCTION_PACK P();
MENTHOD RUN();
rc = get_distinct_values('sashelp.shoes', 'region', 'work.regions');

id=open('work.regions');

if id then nobs=attrn(id,'NOBS');

put nobs;

run;
END;
ENDDATA;
RUN;
QUIT;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 20 Apr 2023 10:40:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELLO-I-have-a-technical-problem-that-needs-to-be-solved/m-p/870746#M343936</guid>
      <dc:creator>_Sas_Beginner_</dc:creator>
      <dc:date>2023-04-20T10:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: HELLO! I have a technical problem that needs to be solved urgently</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELLO-I-have-a-technical-problem-that-needs-to-be-solved/m-p/870747#M343937</link>
      <description>Hello experts, I have a technical problem that needs to be solved urgently, if you can call the macro statement through the "run_macro" statement in the fcmp function, and call the PROC procedure step in the data program step, but the fcmp function cannot be used in proc ds2, it will prompt the error message that "run_macro" is not recognized, how to solve this problem?</description>
      <pubDate>Thu, 20 Apr 2023 10:46:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELLO-I-have-a-technical-problem-that-needs-to-be-solved/m-p/870747#M343937</guid>
      <dc:creator>_Sas_Beginner_</dc:creator>
      <dc:date>2023-04-20T10:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: HELLO! I have a technical problem that needs to be solved urgently</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELLO-I-have-a-technical-problem-that-needs-to-be-solved/m-p/870752#M343940</link>
      <description>&lt;P&gt;Some interesting facts described by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12477"&gt;@RichardDeVen&lt;/a&gt;&amp;nbsp;can be read in this thread:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Output-to-a-Macro-variable-within-DS2/td-p/692726" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Output-to-a-Macro-variable-within-DS2/td-p/692726&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2023 12:17:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELLO-I-have-a-technical-problem-that-needs-to-be-solved/m-p/870752#M343940</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-04-20T12:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: HELLO! I have a technical problem that needs to be solved urgently</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELLO-I-have-a-technical-problem-that-needs-to-be-solved/m-p/870829#M343984</link>
      <description>thanks！but I tried the code you sent me to my website with the error message "Cannot find function" run_macro"";</description>
      <pubDate>Thu, 20 Apr 2023 15:45:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELLO-I-have-a-technical-problem-that-needs-to-be-solved/m-p/870829#M343984</guid>
      <dc:creator>_Sas_Beginner_</dc:creator>
      <dc:date>2023-04-20T15:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: HELLO! I have a technical problem that needs to be solved urgently</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELLO-I-have-a-technical-problem-that-needs-to-be-solved/m-p/870831#M343986</link>
      <description>I mean, run the macro with the fcmp function and then call the fcmp function with proc ds2, but always prompt an error message！</description>
      <pubDate>Thu, 20 Apr 2023 15:48:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELLO-I-have-a-technical-problem-that-needs-to-be-solved/m-p/870831#M343986</guid>
      <dc:creator>_Sas_Beginner_</dc:creator>
      <dc:date>2023-04-20T15:48:18Z</dc:date>
    </item>
    <item>
      <title>Re: HELLO! I have a technical problem that needs to be solved urgently</title>
      <link>https://communities.sas.com/t5/SAS-Programming/HELLO-I-have-a-technical-problem-that-needs-to-be-solved/m-p/870885#M344019</link>
      <description>sorry,I didn't pay attention to the content of the answer，thank you very much！</description>
      <pubDate>Thu, 20 Apr 2023 20:15:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/HELLO-I-have-a-technical-problem-that-needs-to-be-solved/m-p/870885#M344019</guid>
      <dc:creator>_Sas_Beginner_</dc:creator>
      <dc:date>2023-04-20T20:15:43Z</dc:date>
    </item>
  </channel>
</rss>

