<?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: proc metadata.How to get PHYSYCAL name of source to DI studio ETL tables. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-metadata-How-to-get-PHYSYCAL-name-of-source-to-DI-studio/m-p/70104#M20174</link>
    <description>Hi Yura2301.&lt;BR /&gt;
&lt;BR /&gt;
This forum is for general questions about SAS procedures.&lt;BR /&gt;
&lt;BR /&gt;
The &lt;A href="http://support.sas.com/forums/forum.jspa?forumID=59" target="_blank"&gt;SAS Enterprise Data Management &amp;amp; Integration&lt;/A&gt; Forum is dedicated to the kind of of question you're asking. If you post your question there it will be seen by more knowledgeable people. Good luck!</description>
    <pubDate>Tue, 08 Feb 2011 14:20:13 GMT</pubDate>
    <dc:creator>Tim_SAS</dc:creator>
    <dc:date>2011-02-08T14:20:13Z</dc:date>
    <item>
      <title>proc metadata.How to get PHYSYCAL name of source to DI studio ETL tables.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-metadata-How-to-get-PHYSYCAL-name-of-source-to-DI-studio/m-p/70103#M20173</link>
      <description>Hello,&lt;BR /&gt;
So in general I am working on macro which has one parameter - name of ETL(DI studio Job) , and as result this macro must create table with list of source to this ETL tables.&lt;BR /&gt;
For all this goals I use proc metadata and I've almost finished, but one issue appears - name of table in General tab of property menu can be different from real table name which can be find in "Phisical storage" tab.&lt;BR /&gt;
&lt;BR /&gt;
Shortly about how it works- I create XML tamplate with appropritate structure and give it to proc metadata as parameter, and as result creates result XML file which consists of all needed data:&lt;BR /&gt;
&lt;BR /&gt;
  filename in "&amp;amp;workPath\in.xml";&lt;BR /&gt;
  filename out "&amp;amp;workPath\result.xml";&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
    file in;&lt;BR /&gt;
    put '&lt;GETMETADATAOBJECTS&gt;';&lt;BR /&gt;
      put '&lt;REPOSID&gt;$METAREPOSITORY&lt;/REPOSID&gt;';&lt;BR /&gt;
      put '&lt;TYPE&gt;Job&lt;/TYPE&gt;';&lt;BR /&gt;
      put '&lt;NS&gt;SAS&lt;/NS&gt;';&lt;BR /&gt;
      put '&lt;!-- Specify OMI_GET_METADATA (256) + OMI_XMLSELECT (128) + OMI_TEMPLATE (4) + OMI_INCLUDE_SUBTYPES (16) flags --&gt;';&lt;BR /&gt;
      put '&lt;FLAGS&gt;404&lt;/FLAGS&gt;';&lt;BR /&gt;
      put '&lt;OPTIONS&gt;';&lt;BR /&gt;
		put "%bquote(&lt;XMLSELECT search="@Name = '&amp;amp;JobToFind'"&gt;&lt;/XMLSELECT&gt;)";&lt;BR /&gt;
        put '&lt;TEMPLATES&gt;';&lt;BR /&gt;
		...&lt;BR /&gt;
		&lt;BR /&gt;
  proc metadata&lt;BR /&gt;
    header=full&lt;BR /&gt;
    in=in&lt;BR /&gt;
    out=out;&lt;BR /&gt;
  run;	&lt;BR /&gt;
&lt;BR /&gt;
After this I create XMLMap for getting source tables info,It looks like this:&lt;BR /&gt;
&lt;BR /&gt;
 filename xmlMap "&amp;amp;workPath\xmlMap.xml";&lt;BR /&gt;
  data _null_;&lt;BR /&gt;
    file xmlMap;&lt;BR /&gt;
    put '';&lt;BR /&gt;
    put '&lt;SXLEMAP version="1.2" name="Jobs Source Tables" description="XMLMap for Jobs Source Tables"&gt;';&lt;BR /&gt;
     put '&lt;TABLE name="JobST1"&gt;';&lt;BR /&gt;
        put '&lt;TABLE-PATH syntax="xpath"&gt;//Job/JobActivities/TransformationActivity/Steps/TransformationStep/Transformations/ClassifierMap/ClassifierSources/PhysicalTable&lt;/TABLE-PATH&gt;';&lt;BR /&gt;
      put '&lt;COLUMN name="jobSTID"&gt;';&lt;BR /&gt;
           put '&lt;PATH&gt;//Job/JobActivities/TransformationActivity/Steps/TransformationStep/Transformations/ClassifierMap/ClassifierSources/PhysicalTable/@Id&lt;/PATH&gt;';&lt;BR /&gt;
           put '&lt;TYPE&gt;character&lt;/TYPE&gt;';&lt;BR /&gt;
           put '&lt;DATATYPE&gt;string&lt;/DATATYPE&gt;';&lt;BR /&gt;
           put '&lt;LENGTH&gt;32&lt;/LENGTH&gt;';&lt;BR /&gt;
        put '&lt;/COLUMN&gt;';&lt;BR /&gt;
      put '&lt;COLUMN name="jobSTName"&gt;';&lt;BR /&gt;
           put '&lt;PATH&gt;//Job/JobActivities/TransformationActivity/Steps/TransformationStep/Transformations/ClassifierMap/ClassifierSources/PhysicalTable/@Name&lt;/PATH&gt;';&lt;BR /&gt;
           put '&lt;TYPE&gt;character&lt;/TYPE&gt;';&lt;BR /&gt;
           put '&lt;DATATYPE&gt;string&lt;/DATATYPE&gt;';&lt;BR /&gt;
           put '&lt;LENGTH&gt;256&lt;/LENGTH&gt;';&lt;BR /&gt;
        put '&lt;/COLUMN&gt;';&lt;BR /&gt;
      put '&lt;COLUMN name="jobSTDesc"&gt;';&lt;BR /&gt;
           put '&lt;PATH&gt;//Job/JobActivities/TransformationActivity/Steps/TransformationStep/Transformations/ClassifierMap/ClassifierSources/PhysicalTable/@Desc&lt;/PATH&gt;';&lt;BR /&gt;
           put '&lt;TYPE&gt;character&lt;/TYPE&gt;';&lt;BR /&gt;
           put '&lt;DATATYPE&gt;string&lt;/DATATYPE&gt;';&lt;BR /&gt;
           put '&lt;LENGTH&gt;256&lt;/LENGTH&gt;';&lt;BR /&gt;
      put '&lt;/COLUMN&gt;';&lt;BR /&gt;
      put '&lt;/TABLE&gt;';&lt;BR /&gt;
    put '&lt;/SXLEMAP&gt;';&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
And then I extract source tables:&lt;BR /&gt;
&lt;BR /&gt;
libname xmllib xml "&amp;amp;workPath\ResultData.xml" xmlmap=xmlMap;&lt;BR /&gt;
&lt;BR /&gt;
  data WORK.JobSourceTables;&lt;BR /&gt;
    set xmllib.JobST1;&lt;BR /&gt;
  run;&lt;BR /&gt;
&lt;BR /&gt;
But as I describe in begining of this post - name of table in general tab can be different from real physycal table name which can be find in "Phisical storage" tab.&lt;BR /&gt;
&lt;BR /&gt;
The root of this question can be related with appropriate path to physical table, in my case it is:&lt;BR /&gt;
//Job/JobActivities/TransformationActivity/Steps/TransformationStep/Transformations/Select/ClassifierSources/PhysicalTable/@Name&lt;BR /&gt;
&lt;BR /&gt;
But this path gives table name from general tab of property table, but I need name from  "Physical storage" tab, and in documentatiuon I couldn't find how to get this.&lt;BR /&gt;
"PhysicalTable" attribute 3 sub-attributes @id,@name and @desc sub-attributes...So may be  I must check somewhere higher in tree...&lt;BR /&gt;
&lt;BR /&gt;
Thanks in advanced!&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Yura2301&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Yura2301&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Yura2301&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Yura2301&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Yura2301

Message was edited by: Yura2301&lt;/TEMPLATES&gt;&lt;/OPTIONS&gt;&lt;/GETMETADATAOBJECTS&gt;</description>
      <pubDate>Tue, 08 Feb 2011 13:53:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-metadata-How-to-get-PHYSYCAL-name-of-source-to-DI-studio/m-p/70103#M20173</guid>
      <dc:creator>Yura2301</dc:creator>
      <dc:date>2011-02-08T13:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: proc metadata.How to get PHYSYCAL name of source to DI studio ETL tables.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-metadata-How-to-get-PHYSYCAL-name-of-source-to-DI-studio/m-p/70104#M20174</link>
      <description>Hi Yura2301.&lt;BR /&gt;
&lt;BR /&gt;
This forum is for general questions about SAS procedures.&lt;BR /&gt;
&lt;BR /&gt;
The &lt;A href="http://support.sas.com/forums/forum.jspa?forumID=59" target="_blank"&gt;SAS Enterprise Data Management &amp;amp; Integration&lt;/A&gt; Forum is dedicated to the kind of of question you're asking. If you post your question there it will be seen by more knowledgeable people. Good luck!</description>
      <pubDate>Tue, 08 Feb 2011 14:20:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-metadata-How-to-get-PHYSYCAL-name-of-source-to-DI-studio/m-p/70104#M20174</guid>
      <dc:creator>Tim_SAS</dc:creator>
      <dc:date>2011-02-08T14:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: proc metadata.How to get PHYSYCAL name of source to DI studio ETL tables.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-metadata-How-to-get-PHYSYCAL-name-of-source-to-DI-studio/m-p/70105#M20175</link>
      <description>Ok, &lt;BR /&gt;
Thanks!</description>
      <pubDate>Tue, 08 Feb 2011 14:24:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-metadata-How-to-get-PHYSYCAL-name-of-source-to-DI-studio/m-p/70105#M20175</guid>
      <dc:creator>Yura2301</dc:creator>
      <dc:date>2011-02-08T14:24:07Z</dc:date>
    </item>
  </channel>
</rss>

