<?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: SAS DI: How can I extract the code that finds and generates source tables in commented-out text? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/857022#M20665</link>
    <description>&lt;P&gt;So I get this right.&lt;/P&gt;
&lt;P&gt;In the code for DI Studio jobs, you'll find some table names in the header comment.&lt;/P&gt;
&lt;P&gt;For those tables, you wish to extract the table creation code further down in the job code?&lt;/P&gt;
&lt;P&gt;It's probably possible to do anything with advanced parsing of the code.&lt;/P&gt;
&lt;P&gt;What is the use case?&lt;/P&gt;</description>
    <pubDate>Fri, 03 Feb 2023 12:39:33 GMT</pubDate>
    <dc:creator>LinusH</dc:creator>
    <dc:date>2023-02-03T12:39:33Z</dc:date>
    <item>
      <title>SAS DI: How can I extract the code that finds and generates source tables in commented-out text?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/857004#M20664</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Pili1100_0-1675417015370.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/80069i9EEE925A49BAF2A0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Pili1100_0-1675417015370.png" alt="Pili1100_0-1675417015370.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="ui-provider bqk bql c d e f g h i j k l m n o p q r s t bqm bqn w x y z ab ac ae af ag ah ai aj ak"&gt;I have created a dummy text to anonymize.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 09:37:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/857004#M20664</guid>
      <dc:creator>Pili1100</dc:creator>
      <dc:date>2023-02-03T09:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI: How can I extract the code that finds and generates source tables in commented-out text?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/857022#M20665</link>
      <description>&lt;P&gt;So I get this right.&lt;/P&gt;
&lt;P&gt;In the code for DI Studio jobs, you'll find some table names in the header comment.&lt;/P&gt;
&lt;P&gt;For those tables, you wish to extract the table creation code further down in the job code?&lt;/P&gt;
&lt;P&gt;It's probably possible to do anything with advanced parsing of the code.&lt;/P&gt;
&lt;P&gt;What is the use case?&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 12:39:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/857022#M20665</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2023-02-03T12:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI: How can I extract the code that finds and generates source tables in commented-out text?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/857071#M20666</link>
      <description>&lt;P&gt;I would like to extract the source tables so I can further use them in a makro for getting production data to test.&lt;BR /&gt;&lt;SPAN&gt;This will eliminate the need for manual copy/paste into Notepad++&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Feb 2023 15:54:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/857071#M20666</guid>
      <dc:creator>Pili1100</dc:creator>
      <dc:date>2023-02-03T15:54:36Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI: How can I extract the code that finds and generates source tables in commented-out text?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/857329#M20667</link>
      <description>&lt;P&gt;Question is how you wish call this macro, per DI Job, or a whole environment?&lt;/P&gt;
&lt;P&gt;There is a metadata API you could investigate (data step function based).&lt;/P&gt;
&lt;P&gt;If whole environment, or per schema, I would use DICTIONARY.TABLES as a base - assuming your tables are created and accessible in your production environment.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 10:11:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/857329#M20667</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2023-02-06T10:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI: How can I extract the code that finds and generates source tables in commented-out text?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/857510#M20668</link>
      <description>&lt;P&gt;I would like to run the makro per job and get the list of source tables shown in the job header.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would be preferably to have the IDs the joined further. In my example this means&amp;nbsp;A000000.YYYYYYY1 ,&amp;nbsp;Y0000000.YYYYYYY2 and&amp;nbsp;Y0000000. YYYYYYY3&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 09:16:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/857510#M20668</guid>
      <dc:creator>Pili1100</dc:creator>
      <dc:date>2023-02-07T09:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI: How can I extract the code that finds and generates source tables in commented-out text?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/857512#M20669</link>
      <description>&lt;P&gt;If that's the way you wish to do it, you're up for some (advanced) text parsing techniques.&lt;/P&gt;
&lt;P&gt;Good luck!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 09:36:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/857512#M20669</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2023-02-07T09:36:06Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI: How can I extract the code that finds and generates source tables in commented-out text?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/857515#M20670</link>
      <description>&lt;P&gt;That has been explored but was dreaming on a finding a easier way&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Feb 2023 09:47:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/857515#M20670</guid>
      <dc:creator>Pili1100</dc:creator>
      <dc:date>2023-02-07T09:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS DI: How can I extract the code that finds and generates source tables in commented-out text?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/861852#M20672</link>
      <description>&lt;P&gt;Hi &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/363831"&gt;@Pili1100&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I got this right, you want to automate the process of copying tables from Production to Test, so you have updated source data available for testing a given job.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How do you want the solution to work? - I would recommend a solution that works within DI Studio in tne Test environment. A utility job containing a user-defined transformation, where the user can copy-paste one or more Job-ID's from the Basic Properties pane below the Folder Tree into the Transformation's Options-tab. The transformation should do the following:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Extract a list of all source tables with physical paths for the given Job-ID's, and then Loop over the tables and for each table,&lt;/LI&gt;
&lt;LI&gt;allocate a libname to the Test Path,&lt;/LI&gt;
&lt;LI&gt;another to the Production Path and&lt;/LI&gt;
&lt;LI&gt;copy the table using Proc Copy.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;This will work if:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the tables are SAS Base datasets (sas7bdat-files),&lt;/LI&gt;
&lt;LI&gt;the physical folder structures are identical in Test and Production, so the Production path can be derived from the Test path,&lt;/LI&gt;
&lt;LI&gt;the physical Production folder is accessible from the Test environment, and&lt;/LI&gt;
&lt;LI&gt;the user has permission to read the physical dataset.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Getting the list of all source tables with physical paths from metadata is a bit complicated, but not impossible, anf much easier than trying to get the information out of the generated source code. I can help with some code if you are interested, only give me a couple of days because I don't have anything ready that does exactly that. The metadata part will give you the necessary information, so you could implement a solution as a DI Studio job or wharever you prefer.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Mar 2023 21:35:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-DI-How-can-I-extract-the-code-that-finds-and-generates/m-p/861852#M20672</guid>
      <dc:creator>ErikLund_Jensen</dc:creator>
      <dc:date>2023-03-01T21:35:02Z</dc:date>
    </item>
  </channel>
</rss>

