<?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: Need inspiration for  a  configuration file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-inspiration-for-a-configuration-file/m-p/906832#M358066</link>
    <description>&lt;P&gt;You mean something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro executeMyProcess(
 inputDataSet=
,analysis1=N
,analysis2=N
,analysis3=N
);


%if %syperq(analysis1) = Y %then
  %do;
    %regression_is_one_macro1()  /* from file regression_is_one_macro1.sas  */
  %end;

%if %syperq(analysis2) = Y %then
  %do;
    %another_statitics2() /* from file another_statitics2.sas */
  %end;

%if %syperq(analysis2) = Y %then
  %do;
    %another_statisticN() /* from file another_statisticN.sas*/
  %end;

  /*
    ...
  */


%mend executeMyProcess;


%executeMyProcess(
inputDataSet=sashelp.class;
,analysis2=Y
,analysis3=Y
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
    <pubDate>Thu, 07 Dec 2023 19:43:04 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2023-12-07T19:43:04Z</dc:date>
    <item>
      <title>Need inspiration for  a  configuration file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-inspiration-for-a-configuration-file/m-p/906783#M358046</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm want to programming a code that's is like a configuration file? I have something like this now :&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.PNG" style="width: 367px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/90952iF976DB00B49E9B24/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and all of this statistic tools are differents marcro.sas-files (regression is one macro1.sas, another_statitics2.sas , another_statisticN.sas and so on)&lt;/P&gt;&lt;P&gt;and this configurations file.xlsx is depending on what you want to run for the statistics (y/n) and there for call the macros. Like this is the input for running all the statistics.&lt;BR /&gt;&lt;BR /&gt;But I think this is not an good option, I want everything to be controlled by a sas-program&amp;nbsp; for all the inputs, (something like pythons input()-function.&amp;nbsp; Or like a check-list?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Please, do anyone have a good inspiration? I'm not a senior at programing &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Maybe it is not possible? I don't even know what to search at google :S&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards,&amp;nbsp;&lt;/P&gt;&lt;P&gt;(sorry my english is not my 1st language)&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 18:20:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-inspiration-for-a-configuration-file/m-p/906783#M358046</guid>
      <dc:creator>melhaf</dc:creator>
      <dc:date>2023-12-07T18:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Need inspiration for  a  configuration file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-inspiration-for-a-configuration-file/m-p/906796#M358055</link>
      <description>&lt;P&gt;the input() function pops up in interactive pythons console as far as I understand that function.&lt;/P&gt;
&lt;P&gt;In SAS case we don't have that kind "interactive" console right away.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have windows DMS SAS session you could use %WINDOW command to generate popping up window which can grab parameters (but it's only for DMS)&lt;/P&gt;
&lt;P&gt;In Enterprise Guide you could set project prompts popping up at start of the process, but again it's EG specific.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;xlsx file has this advantage that you can edit it easily, "double check" values before run, etc.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;one more option I would consider is a "trivial" txt file with form:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;paramerter1:value1
paramerter2:value2
paramerter3:value3
...
...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;instead xlsx, txt file is easier to modify on every OS, does not require MS Excel, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 18:39:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-inspiration-for-a-configuration-file/m-p/906796#M358055</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-07T18:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Need inspiration for  a  configuration file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-inspiration-for-a-configuration-file/m-p/906801#M358057</link>
      <description>&lt;P&gt;one more advantage of the "let's make a file" approach, you can have several such files created an just waiting to be used &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 18:43:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-inspiration-for-a-configuration-file/m-p/906801#M358057</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-07T18:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: Need inspiration for  a  configuration file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-inspiration-for-a-configuration-file/m-p/906826#M358065</link>
      <description>hello, i don't want it to be a file, i want to have something like this but you say y/n, input dates (from, to) in sas - maybe as a macro? I don't want to have excel at all</description>
      <pubDate>Thu, 07 Dec 2023 19:32:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-inspiration-for-a-configuration-file/m-p/906826#M358065</guid>
      <dc:creator>melhaf</dc:creator>
      <dc:date>2023-12-07T19:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Need inspiration for  a  configuration file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-inspiration-for-a-configuration-file/m-p/906832#M358066</link>
      <description>&lt;P&gt;You mean something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro executeMyProcess(
 inputDataSet=
,analysis1=N
,analysis2=N
,analysis3=N
);


%if %syperq(analysis1) = Y %then
  %do;
    %regression_is_one_macro1()  /* from file regression_is_one_macro1.sas  */
  %end;

%if %syperq(analysis2) = Y %then
  %do;
    %another_statitics2() /* from file another_statitics2.sas */
  %end;

%if %syperq(analysis2) = Y %then
  %do;
    %another_statisticN() /* from file another_statisticN.sas*/
  %end;

  /*
    ...
  */


%mend executeMyProcess;


%executeMyProcess(
inputDataSet=sashelp.class;
,analysis2=Y
,analysis3=Y
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2023 19:43:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-inspiration-for-a-configuration-file/m-p/906832#M358066</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-07T19:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Need inspiration for  a  configuration file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-inspiration-for-a-configuration-file/m-p/906912#M358069</link>
      <description>&lt;P&gt;That's loos cool &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt; haven't deep dive into it yet, but at a first glance (Y) &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, do I the person who is gonna use this, have to go to this macro/code and manually put Y / N then? Or can that be a pyhtons equivalite to input() . Hmm maybe a %let=y; /*put y for yes, n for no?*/ can you have a macro in a macro? ^^&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 06:18:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-inspiration-for-a-configuration-file/m-p/906912#M358069</guid>
      <dc:creator>melhaf</dc:creator>
      <dc:date>2023-12-08T06:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Need inspiration for  a  configuration file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-inspiration-for-a-configuration-file/m-p/906934#M358074</link>
      <description>&lt;P&gt;If your SAS session "knows" the definition of a macro all you need to run in your session is this snippet:&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;%executeMyProcess(
inputDataSet=sashelp.class;
,analysis2=Y
,analysis3=Y
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;(you can compare it to the situation where you are using some function in Python which was imported from a packages). So at the beginning of the session you have to tell SAS where the macro definition is stored.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In 99% cases having a macro definition inside the definition of another macro is considered bad programming practice. But in 99.9% cases &lt;EM&gt;calling&lt;/EM&gt; a macro inside another macro is standard way of coding.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The way I would organise my code would be by creating a&amp;nbsp; SAS Package (here is link: &lt;A href="https://github.com/yabwon/SAS_PACKAGES)" target="_blank"&gt;https://github.com/yabwon/SAS_PACKAGES)&lt;/A&gt;. I would wrap my code from each file inside macros and then add one more "driving" macro (like the one I showed). Then at the beginning of a SAS session you, or other user would load the package, and then could run the snippet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Dec 2023 09:15:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-inspiration-for-a-configuration-file/m-p/906934#M358074</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-12-08T09:15:04Z</dc:date>
    </item>
  </channel>
</rss>

