<?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: Tools to trace back multi-step Processes : Base SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Tools-to-trace-back-multi-step-Processes-Base-SAS/m-p/554582#M154284</link>
    <description>Thank you Erik, more than specific code it’s related to a general good practice, this is the problem: I build large pieces of code pulling data from multiple sources, then applying business rules in 2+ data/proc steps.&lt;BR /&gt;During testing or after process is in production I get questions along these lines:&lt;BR /&gt;- why my specific account doesn’t show on reports?. This type of question usually leads me to dig into the code and see at what point the record(s) were dropped. I do this by running the code and then exploring each step to see what business rule made the record drop.. which is time consuming. Hence my question, my guess I’m not the first one asking&lt;BR /&gt;&lt;BR /&gt;Thank you for replying,&lt;BR /&gt;&lt;BR /&gt;Darío</description>
    <pubDate>Sun, 28 Apr 2019 13:52:50 GMT</pubDate>
    <dc:creator>dario_medina</dc:creator>
    <dc:date>2019-04-28T13:52:50Z</dc:date>
    <item>
      <title>Tools to trace back multi-step Processes : Base SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tools-to-trace-back-multi-step-Processes-Base-SAS/m-p/554501#M154270</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;In my experience building SAS processes I spend lots of time tracking down &amp;nbsp;issues/conditions that drop/include records When the process involves multiple steps. Any ideas or bests practices will be appreciated&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dario&lt;/P&gt;</description>
      <pubDate>Sat, 27 Apr 2019 17:58:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tools-to-trace-back-multi-step-Processes-Base-SAS/m-p/554501#M154270</guid>
      <dc:creator>dario_medina</dc:creator>
      <dc:date>2019-04-27T17:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Tools to trace back multi-step Processes : Base SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tools-to-trace-back-multi-step-Processes-Base-SAS/m-p/554568#M154281</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/176702"&gt;@dario_medina&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would be easier to help you if you provided some example code, or at least a skeleton code to show a sequence of steps, because it is not quite clear whar the problem is. But you might have fallen into the bad habit to reuse your input dataset as output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the following example it is impossible to see what happens where:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want; set have;
	if &amp;lt;drop condition&amp;gt; then delete;
run;

data want; set want;
	if &amp;lt;another drop condition&amp;gt; then delete;
run;

data want; set want;
	if &amp;lt;keep contition&amp;gt; then output;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Use different output data sets and keep the dropped records for control purposes. Then it is easy to track down what happens where:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want1 drop1; set have;
	if not &amp;lt;drop condition&amp;gt; then output want1;
	else output drop1
run;

data want2 drop2; set want1;
	if not &amp;lt;another drop condition&amp;gt; then output want2
	else output drop2;
run;

data want3 drop3; set want2;
	if &amp;lt;keep condition&amp;gt; then output want3;
	else output drop3;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When everything works you can change your code to avoid creation of drop-datasets.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Apr 2019 10:02:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tools-to-trace-back-multi-step-Processes-Base-SAS/m-p/554568#M154281</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2019-04-28T10:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Tools to trace back multi-step Processes : Base SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tools-to-trace-back-multi-step-Processes-Base-SAS/m-p/554582#M154284</link>
      <description>Thank you Erik, more than specific code it’s related to a general good practice, this is the problem: I build large pieces of code pulling data from multiple sources, then applying business rules in 2+ data/proc steps.&lt;BR /&gt;During testing or after process is in production I get questions along these lines:&lt;BR /&gt;- why my specific account doesn’t show on reports?. This type of question usually leads me to dig into the code and see at what point the record(s) were dropped. I do this by running the code and then exploring each step to see what business rule made the record drop.. which is time consuming. Hence my question, my guess I’m not the first one asking&lt;BR /&gt;&lt;BR /&gt;Thank you for replying,&lt;BR /&gt;&lt;BR /&gt;Darío</description>
      <pubDate>Sun, 28 Apr 2019 13:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tools-to-trace-back-multi-step-Processes-Base-SAS/m-p/554582#M154284</guid>
      <dc:creator>dario_medina</dc:creator>
      <dc:date>2019-04-28T13:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Tools to trace back multi-step Processes : Base SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tools-to-trace-back-multi-step-Processes-Base-SAS/m-p/554590#M154289</link>
      <description>How about rather than dropping the record in intermediate steps you add a Y/N drop-flag and a Reason-to-drop column.&lt;BR /&gt;&lt;BR /&gt;Lot easier to debug.</description>
      <pubDate>Sun, 28 Apr 2019 15:03:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tools-to-trace-back-multi-step-Processes-Base-SAS/m-p/554590#M154289</guid>
      <dc:creator>smijoss1</dc:creator>
      <dc:date>2019-04-28T15:03:00Z</dc:date>
    </item>
    <item>
      <title>Re: Tools to trace back multi-step Processes : Base SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Tools-to-trace-back-multi-step-Processes-Base-SAS/m-p/554734#M154350</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/176702"&gt;@dario_medina&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Thank you Erik, more than specific code it’s related to a general good practice, this is the problem: I build large pieces of code pulling data from multiple sources, then applying business rules in 2+ data/proc steps.&lt;BR /&gt;During testing or after process is in production I get questions along these lines:&lt;BR /&gt;- why my specific account doesn’t show on reports?. This type of question usually leads me to dig into the code and see at what point the record(s) were dropped. I do this by running the code and then exploring each step to see what business rule made the record drop.. which is time consuming. Hence my question, my guess I’m not the first one asking&lt;BR /&gt;&lt;BR /&gt;Thank you for replying,&lt;BR /&gt;&lt;BR /&gt;Darío&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;In addition to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/144921"&gt;@smijoss1&lt;/a&gt;&amp;nbsp;suggestion for records removed in a data step you might consider instead of a simple delete to write the records to a removed data set. A very broad outline of this approach:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data continue (drop=&amp;lt;list of the removal flag variables&amp;gt;)
     removed
;
   set have;
   &amp;lt;set removal reason flags&amp;gt;
   if &amp;lt;and of the removal flags are set&amp;gt; then output removed;
   else output continue;
run;&lt;/PRE&gt;
&lt;P&gt;If records are removed in other procedures then a description of how that is done may be needed. For more targeted responses.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Apr 2019 15:11:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Tools-to-trace-back-multi-step-Processes-Base-SAS/m-p/554734#M154350</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-04-29T15:11:04Z</dc:date>
    </item>
  </channel>
</rss>

