<?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: executing an x command based on a return code in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/executing-an-x-command-based-on-a-return-code/m-p/353203#M10527</link>
    <description>&lt;P&gt;ok.. so,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just tried something I hadn't done before. In the status handling tab, maybe due to overthinking the solution.&lt;/P&gt;&lt;P&gt;I set up a successful condition, and in 'action options', I added my x cmd in the 'value'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems to work based on my quick tests and changing the value from 'successful' to 'error' and back again to see what happens.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is this really the correct way to do this from a code standpoint..?&lt;/P&gt;&lt;P&gt;I've learned over time, that just because something works, it's not always the best code practice to accomplish the given task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Apr 2017 14:27:24 GMT</pubDate>
    <dc:creator>cnilsen</dc:creator>
    <dc:date>2017-04-25T14:27:24Z</dc:date>
    <item>
      <title>executing an x command based on a return code</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/executing-an-x-command-based-on-a-return-code/m-p/353192#M10526</link>
      <description>&lt;P&gt;Good Morning all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to do something which I believe is relatively simple, but cannot find any sort of examples of how to do..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a DI studio (4.901) job with several transformations. this basically reads files in, performs some minor editing, and outputs the results into larger staging table . When a particular transformation (table loader) completes WITHOUT error, I'd like to have an x cmd run to copy/move the file I have just processed into an archive dirrectory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have added the x cmd to postcode already for testing, and it works as I need it to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;X cp -a /dmadata/AS400/CDH_* /dmadata/AS400_ARCH/;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this will copy my 'CDH_xxxxxxxxxxxx' table into an archive directory '&lt;SPAN&gt;/dmadata/AS400_ARCH/'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now, I want to add a return code check to ensure that the transformation was successful PRIOR to this copy statement.&lt;/P&gt;&lt;P&gt;I have read about using the status handling tab, but all examples I have read about reference adding a record to an error log, or a adding to a table. I dont want to create a macro just for this if possible. I'd like to keep all my code within the transformation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any ideas?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards,&lt;/P&gt;&lt;P&gt;-Chris N.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 13:47:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/executing-an-x-command-based-on-a-return-code/m-p/353192#M10526</guid>
      <dc:creator>cnilsen</dc:creator>
      <dc:date>2017-04-25T13:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: executing an x command based on a return code</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/executing-an-x-command-based-on-a-return-code/m-p/353203#M10527</link>
      <description>&lt;P&gt;ok.. so,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I just tried something I hadn't done before. In the status handling tab, maybe due to overthinking the solution.&lt;/P&gt;&lt;P&gt;I set up a successful condition, and in 'action options', I added my x cmd in the 'value'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems to work based on my quick tests and changing the value from 'successful' to 'error' and back again to see what happens.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is this really the correct way to do this from a code standpoint..?&lt;/P&gt;&lt;P&gt;I've learned over time, that just because something works, it's not always the best code practice to accomplish the given task.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 14:27:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/executing-an-x-command-based-on-a-return-code/m-p/353203#M10527</guid>
      <dc:creator>cnilsen</dc:creator>
      <dc:date>2017-04-25T14:27:24Z</dc:date>
    </item>
  </channel>
</rss>

