<?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 Conditionally execute precode and postcode in SAS DI studio in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663734#M19342</link>
    <description>&lt;P&gt;I've the ETL Jobs in DI Studio where it has precode and postcode as below. Main purpose of this code to get the Job Status and&amp;nbsp;write in the SQL table.However I don't want this precode and postcode to execute when any of the ETL Job needs an update or enhancement. I don't wish to remove the precode and postcode either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS program for the macro %Job_status is called in autoexec file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm looking for an way to control the precode and postcode macro execution by macro variable. E.g.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;%let run_macro_pre_post_code=Y;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;when I need to run precode and postcode and when&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;%let run_macro_pre_post_code=N;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;then precode and postcode should not run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/*Precode*/
%job_status(_status=STARTED,                                      
                _jobName=&amp;amp;etls_jobName. 
               );  

/*Postcode*/
%job_status(_status=FINISHED,                                     
                _jobName=&amp;amp;etls_jobName., 
                _job_return_code=&amp;amp;syscc.
   ); &lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;I would be thankful if someone of you&amp;nbsp;help me with the logic or the program to accomplish it.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Sat, 20 Jun 2020 17:55:17 GMT</pubDate>
    <dc:creator>David_Billa</dc:creator>
    <dc:date>2020-06-20T17:55:17Z</dc:date>
    <item>
      <title>Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663734#M19342</link>
      <description>&lt;P&gt;I've the ETL Jobs in DI Studio where it has precode and postcode as below. Main purpose of this code to get the Job Status and&amp;nbsp;write in the SQL table.However I don't want this precode and postcode to execute when any of the ETL Job needs an update or enhancement. I don't wish to remove the precode and postcode either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS program for the macro %Job_status is called in autoexec file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm looking for an way to control the precode and postcode macro execution by macro variable. E.g.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;%let run_macro_pre_post_code=Y;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;when I need to run precode and postcode and when&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;%let run_macro_pre_post_code=N;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;then precode and postcode should not run.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;/*Precode*/
%job_status(_status=STARTED,                                      
                _jobName=&amp;amp;etls_jobName. 
               );  

/*Postcode*/
%job_status(_status=FINISHED,                                     
                _jobName=&amp;amp;etls_jobName., 
                _job_return_code=&amp;amp;syscc.
   ); &lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;I would be thankful if someone of you&amp;nbsp;help me with the logic or the program to accomplish it.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 17:55:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663734#M19342</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-06-20T17:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663735#M19343</link>
      <description>&lt;P&gt;Add a macro program:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let run_macro_pre_post_code= Y; /* or N */
%macro chk(flag);
    %if &amp;amp;flag = Y %then %do;
          %job_status( _sattus=STARTED, _jobname= ...);
    %end; %else %do;
         %job_status( _sattus=FINISHED, _jobname= ...);
    %end;
%mend;
%chk(&amp;amp;run_macro_pre_post_code);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 20 Jun 2020 18:02:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663735#M19343</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-06-20T18:02:40Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663739#M19344</link>
      <description>Thank you. It seems you have combined precode and postcode in one macro&lt;BR /&gt;'chk'. Is that right or should I use the same approach but separately in&lt;BR /&gt;precode and postcode?</description>
      <pubDate>Sat, 20 Jun 2020 18:23:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663739#M19344</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-06-20T18:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663740#M19345</link>
      <description>&lt;P&gt;You can submit the macro program once then run:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro chk(flag);
    %if &amp;amp;flag = Y %then %do;
          %job_status( _sattus=STARTED, _jobname= ...);
    %end; %else %do;
         %job_status( _sattus=FINISHED, _jobname= ...);
    %end;
%mend;

%chk(Y);
...submit yours body job ...
%chk(N);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 20 Jun 2020 18:40:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663740#M19345</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-06-20T18:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663743#M19346</link>
      <description>&lt;P&gt;Sorry, it seems that I misunderstood what you are looking for.&lt;/P&gt;
&lt;P&gt;On 2nd reading you want to control running or ignoring precode and postcode per run,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;then a slight change need:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro chk(r_code, flag);
    %if r_code ne Y %then %goto exit;
    %if &amp;amp;flag = 1 %then %do;
          %job_status( _sattus=STARTED, _jobname= ...);
    %end; %else 
    %if &amp;amp;flag = 2 %then %do;
         %job_status( _sattus=FINISHED, _jobname= ...);
    %end;

:exit;
%mend;

%chk(&amp;amp;run_macro_pre_post_code , 1);
...submit yours body job ...
%chk(&amp;amp;run_macro_pre_post_code , 2);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 19:03:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663743#M19346</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-06-20T19:03:17Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663744#M19347</link>
      <description>It appears that you have misunderstood the requirement. If you see my&lt;BR /&gt;initial post, I mentioned that I want to run both precode and postcode if&lt;BR /&gt;condition is met. That condition can be based on macro variable which&lt;BR /&gt;should  holds the value either Y or N.&lt;BR /&gt;&lt;BR /&gt;I have over 100 ETL jobs which has both precode and postcode and it same&lt;BR /&gt;for all those jobs. With your approach it might be painful to update all&lt;BR /&gt;the 100 jobs with the IF condition.&lt;BR /&gt;&lt;BR /&gt;Instead I'm looking for a way how smartly we can add if condition as macro&lt;BR /&gt;in separate program and call/use that macro in the job.&lt;BR /&gt;&lt;BR /&gt;With one macro variable, I want to control whether to run the precode and&lt;BR /&gt;postcode of the job. It will be helpful when I do some enhancement of the&lt;BR /&gt;jobs where I don't want to test my enhance with the pre/post code.&lt;BR /&gt;&lt;BR /&gt;By this job I don't want to redeploy all the 100 jobs and it can be solved&lt;BR /&gt;by deploying one new job which has conditional macro.&lt;BR /&gt;</description>
      <pubDate>Sat, 20 Jun 2020 19:12:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663744#M19347</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-06-20T19:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663745#M19348</link>
      <description>Thank you. Any other alternative way to tackle it as this method leads to&lt;BR /&gt;update and redeployment of all the ETL jobs?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 20 Jun 2020 19:21:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663745#M19348</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-06-20T19:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663746#M19349</link>
      <description>&lt;P&gt;Would you prefer make a slight change to your macro: %job_status:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro job_status(_status= , _jobname= );
      %if &amp;amp;run_macro_pre_post_code ne Y %then %goto exit;
       ..... your macro code ....

%exit:
%mend job_status;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;then just add per job&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;%let run_macro_pre_post_code= Y; /* or N */&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 19:26:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663746#M19349</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-06-20T19:26:46Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663748#M19350</link>
      <description>&lt;P&gt;Can you elaborate this statement ? What do you mean by executing the Job while it needs an update or enhancement ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;EM&gt;However I don't want this precode and postcode to execute when any of the ETL Job needs an update or enhancement&lt;/EM&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 19:39:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663748#M19350</guid>
      <dc:creator>sas_savvy</dc:creator>
      <dc:date>2020-06-20T19:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663749#M19351</link>
      <description>It again leads to change of all the pre/post code of the jobs as macro&lt;BR /&gt;job_status call is unique across and if I want to change the way for&lt;BR /&gt;execution then I need to change in all the jobs.&lt;BR /&gt;</description>
      <pubDate>Sat, 20 Jun 2020 19:42:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663749#M19351</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-06-20T19:42:11Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663751#M19352</link>
      <description>Assume I have 100 ETL jobs and all those has same precode and postcode as I&lt;BR /&gt;mentioned in the initial post. Now if I want to make changes (e.g.&lt;BR /&gt;add/remove transformation) in anyone of the job, then I don't want pre/post&lt;BR /&gt;code to run as it's literally a unit testing after enhancement and I don't&lt;BR /&gt;want to capture the job status in SQL table.&lt;BR /&gt;&lt;BR /&gt;Ofcourse I will add the pre/post code in. that ETL job, once testing is&lt;BR /&gt;done for the changes which I made.&lt;BR /&gt;</description>
      <pubDate>Sat, 20 Jun 2020 19:48:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663751#M19352</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-06-20T19:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663754#M19353</link>
      <description>&lt;P&gt;Assuming you are making changes&amp;nbsp; to few jobs among the 100 jobs that you have , what is the difficulty in commenting the pre and post code for those few while testing?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ideally, this type of features need to controlled via an external control tables where you have the full list of Jobs where you have set a Y/N flag to control a behavior for a particular Job.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 20:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663754#M19353</guid>
      <dc:creator>sas_savvy</dc:creator>
      <dc:date>2020-06-20T20:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663755#M19354</link>
      <description>&lt;P&gt;Changing macro job_status you need do once only.&lt;/P&gt;
&lt;P&gt;Any time you recall the macro to run, in any job, it will use the new/updated macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have already defined the statement&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let run_macro_pre_post_code=Y; /* or N */
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;in the jobs?&lt;/P&gt;
&lt;P&gt;if positive then required work is done and no more changes need.&lt;/P&gt;
&lt;P&gt;If negative then it depends on the tool you use to submit a set of ETL jobs.&lt;/P&gt;
&lt;P&gt;Do you need the macro run_macro_pre_post_code assignment &lt;STRONG&gt;per job&lt;/STRONG&gt;?&lt;/P&gt;
&lt;P&gt;or per a run of &lt;STRONG&gt;all&amp;nbsp;submitted jobs&lt;/STRONG&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 20:06:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663755#M19354</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2020-06-20T20:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663766#M19355</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292396"&gt;@David_Billa&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I've the ETL Jobs in DI Studio where it has precode and postcode as below. Main purpose of this code to get the Job Status and&amp;nbsp;write in the SQL table.However I don't want this precode and postcode to execute when any of the ETL Job needs an update or enhancement. I don't wish to remove the precode and postcode either.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS program for the macro %Job_status is called in autoexec file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;The macro definition for %job_status belongs as .sas file into a folder which is part of the SAS Autocall facility and not into an autoexec.&lt;/P&gt;
&lt;P&gt;Are you allowed to change anything in the autoexec (btw: any changes belong into autoexec_usermods.sas and NOT autoexec.sas)?&lt;/P&gt;
&lt;P&gt;Easiest way would be:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Have the macro definition in an a folder which is part of the SAS Autocall facility (paths defined via option SASAUTOS)&lt;/P&gt;
&lt;P&gt;2. Add at the beginning of SASAUTOS a path to your HOME directory (i.e. ~/overlaymacros) - ideally done in autoexec_usermods.sas&lt;/P&gt;
&lt;P&gt;3. During development add a .sas file to your HOME directory (i.e. ~/overlaymacros/job_status.sas) with below code in it:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro job_status(
    _status=,                                     
    _jobName=, 
    _job_return_code=
   ); 
%mend;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So now what will happen: If in a new DIS session under your user the pre/post code calls the macro then SAS will search for it and first find the macro definition in&amp;nbsp;~/overlaymacros/job_status.sas. SAS will then compile and execute this "empty shell" macro. Once you're done with your unit testing just remove or rename&amp;nbsp;&amp;nbsp;~/overlaymacros/job_status.sas and once you start a new DIS session SAS won't find the macro anymore in your Home directory and though will use the "productive" one. Taking such an approach has the advantage that you don't need to change or comment your pre-code and that you can overlay the macro for your sessions without impact for anyone else.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 23:17:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663766#M19355</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-06-20T23:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663799#M19356</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/331659"&gt;@sas_savvy&lt;/a&gt;&amp;nbsp;yes we can comment it but in the future we will be adding macros in pore/post code of&amp;nbsp;each and every transformations like we did for Job pre/post code to capture the return code of the transformations in SQL table. In that case . it is not easy to comment the pre/post of every tansformation while I update and unit test any of the ETL Job.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can,&amp;nbsp;please help me with the some example code which determine the way to accomplish it using external tables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 07:05:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663799#M19356</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-06-21T07:05:32Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663800#M19357</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&amp;nbsp;No, I don't have this statement defined in the job. But I can define it from Scheduler and so no changes are required in the job. As you told, I just have to change the macro definition %Job_status once.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let run_macro_pre_post_code=Y;&lt;/PRE&gt;
&lt;P&gt;Yes, I need the macro run_macro_pre_post_code assignment &lt;STRONG&gt;per Job.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 07:10:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663800#M19357</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-06-21T07:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663802#M19358</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;&amp;nbsp;I allowed to change autoexec_usermods.sas and NOT autoexec.sas.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the future we will be adding macros in pore/post code of&amp;nbsp;each and every transformations like we did for Job pre/post code to capture the return code of the transformations in SQL table. In that case it is not easy to comment the pre/post of every tansformation while I update and unit test any of the ETL Job.&lt;/P&gt;
&lt;P&gt;e.g.&lt;/P&gt;
&lt;PRE&gt;%let transformName = %nrbquote(Extract_to_pull_IDs); /*Extract_to_pull_IDs  is the value to denote the functional meaning of  the particular step/Transformation and we will passing this values manually*/
%&amp;lt;Macro_to_update_the_SQL_table_with_the _ransformation_Name&amp;gt;;&lt;/PRE&gt;
&lt;P&gt;Also we will be updating the Job pre/post code with one more macro as below alongside %job_status. Here also we will be passing the values manually only during adding this Feature. Once it is done, we will not be touching this value/macro unless it is really required.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%job_audit(_status=STARTED,
               _jobName=&amp;amp;etls_jobName.,      
               _Input_library=&amp;lt;value of Input library&amp;gt;,                       
               _input_table=&amp;lt;value of Input table&amp;gt;               
               _output_library=&amp;lt;value of output library&amp;gt;,
               _output_table=&amp;lt;value of output table&amp;gt;                  
  );&lt;/PRE&gt;
&lt;P&gt;So my objective is to, I don't want any of the pre/post code in job or Transformation to run while I update the Job. Because it's a part of development work and those occasions I don't want anything to update in SQL table.Only during enhancement or update to the Jobs I want to turn off all the pre/post code of the respective job and the transformations involved in that job.&lt;/P&gt;</description>
      <pubDate>Sun, 21 Jun 2020 07:31:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663802#M19358</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-06-21T07:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663809#M19359</link>
      <description>&lt;P&gt;You need to clearly distinguish between Macro Definition and Macro Call. The Macro Definition does NOT belong into the DI job but into a separate .sas file stored in a folder which is part of the SAS Macro Autocall Facility. The Macro Call is what belongs into the DIS job.&lt;/P&gt;
&lt;P&gt;If you want this for every single transformation then consider to define default parameter values in the Macro Definition or use DIS generated macro variables in the macro wherever possible so you don't have to pass a lot of parameters every time you call the macro - plus you can change the defaults in a single place should there ever be the need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now for "disabling" the macros during development: Well, if you've got the macro calls in that many places then having such "overlay" macros as I've already proposed looks to me like a very feasible and easy to manage approach; and it doesn't require any change to the DIS job itself to switch between the productive and the "empty shell" versions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might also want to look into Status Handling. The Custom Action there allows to insert macro calls and if done this way then the generated code will also work in case the SAS job throws an Error.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 19:21:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663809#M19359</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-06-24T19:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663818#M19360</link>
      <description>May I request you to help me with your approach in one small example?&lt;BR /&gt;&lt;BR /&gt;I'm unable to follow your instructions fully but  I will once you tell me&lt;BR /&gt;with example.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 21 Jun 2020 09:29:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663818#M19360</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-06-21T09:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionally execute precode and postcode in SAS DI studio</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663940#M19361</link>
      <description>&lt;P&gt;There is too much to explain if I have to start from scratch. Can you please be a bit more specific which bit you don't get?&lt;/P&gt;
&lt;P&gt;What's important: You need to understand how the SAS Autocall Facility/SAS Autocall Macros work and how SAS finds/compiles macro code for execution when you call it. If you don't know this bit then start reading &lt;A href="https://go.documentation.sas.com/?docsetId=mcrolref&amp;amp;docsetTarget=n1o5fkxq0gqdpcn1xs3ksdks69tf.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;and also do some Googling and read some of the Whitepapers.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 10:04:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Conditionally-execute-precode-and-postcode-in-SAS-DI-studio/m-p/663940#M19361</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-06-22T10:04:54Z</dc:date>
    </item>
  </channel>
</rss>

