<?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 to get Dependent Objects in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/278355#M7864</link>
    <description>Superb. Thanks a ton</description>
    <pubDate>Sat, 18 Jun 2016 10:32:54 GMT</pubDate>
    <dc:creator>yashpande</dc:creator>
    <dc:date>2016-06-18T10:32:54Z</dc:date>
    <item>
      <title>Proc Metadata to get Dependent Objects</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/275297#M7707</link>
      <description>&lt;P&gt;Hi There,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We have got SAS DI Jobs and I am trying to findout all list of SAS Jobs present in repository and its inputs and Outputs tables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have heard a lot about PROC Metadata and have gone through the SAS Docs , however I couldnot find the information on looping through the entire repository.Some direction to the approach would be really appreiated.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2016 03:55:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/275297#M7707</guid>
      <dc:creator>yashpande</dc:creator>
      <dc:date>2016-06-06T03:55:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Metadata to get Dependent Objects</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/275301#M7708</link>
      <description>&lt;P&gt;This below code is using data step metadata function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Note - &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;nobj = metadata_getnobj("omsobj:Job?@Name contains ''", n, job_uri);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It would run for all jobs in foundation repository. In case you want to test for a particular job then update the statement as shown below&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;nobj = metadata_getnobj("omsobj:Job?@Name contains ''&amp;lt;Jobname without .sas &amp;gt;", n, job_uri);&lt;/SPAN&gt;&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;**********************************************************&lt;BR /&gt;options metaserver="&amp;lt;server&amp;gt;"&lt;BR /&gt;metaport=8561&lt;BR /&gt;metaprotocol=bridge&lt;BR /&gt;metarepository="Foundation"&lt;BR /&gt;metauser=&amp;lt;user name&amp;gt;&lt;BR /&gt;metapass=&amp;lt;password&amp;gt;;&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;data Job_input_output;&lt;/P&gt;&lt;P&gt;length job_name job_uri ctrl_order_uri step_uri step_name src_uri src_lib_uri tgt_lib_uri tree_uri jf_uri job_name src_name src_lib_nm tgt_uri tgt_name tgt_lib_nm $256 ;&lt;/P&gt;&lt;P&gt;/* To initialize variables */ nobj = 1; n = 0;&lt;/P&gt;&lt;P&gt;keep job_name step_name src_name src_lib_nm tgt_name tgt_lib_nm lib_uri ;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;do while(nobj &amp;gt;= 0 ); /* Loop start- Determine how many jobs are on this repository and identify inputs &amp;amp; outputs. */&lt;BR /&gt;n = n+1;&lt;/P&gt;&lt;P&gt;/* To get the number of jobs */&lt;BR /&gt;nobj = metadata_getnobj("omsobj:Job?@Name contains ''", n, job_uri);&lt;BR /&gt;put "nobj =" nobj "n = " n;&lt;BR /&gt;if n = 1 then do;&lt;BR /&gt;call symput('nobj', trim(left(nobj))); /* Number of Job objects found. */&lt;BR /&gt;if nobj lt 1 then do;&lt;BR /&gt;put 'Note: No Job objects found in this repository.';&lt;BR /&gt;stop;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;/* To get job name */&lt;BR /&gt;rc= metadata_getattr(job_uri,'Name',job_name);&lt;BR /&gt;rc= metadata_getattr(job_uri,'Name',job_name);&lt;BR /&gt;rc_jf = metadata_getnasn(job_uri, 'JFJobs', 1, jf_uri);&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;/* get the Custom association - control order */&lt;BR /&gt;rc = metadata_getnasn(job_uri, 'CustomAssociations', 1, ctrl_order_uri);&lt;BR /&gt;/*find out how many steps are associated */&lt;BR /&gt;n_steps = metadata_getnasn(ctrl_order_uri, 'AssociatedObjects', 1, step_uri);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;do s = 1 to n_steps; /*Loop start - to obtain all transfromation in a job */&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* get details of each step*/&lt;BR /&gt;Transformation_step=s;&lt;BR /&gt;rc = metadata_getnasn(ctrl_order_uri, 'AssociatedObjects', s, step_uri);&lt;BR /&gt;rc = metadata_getattr(step_uri, 'Name', step_name);&lt;/P&gt;&lt;P&gt;/* for each Step, get the Transformations assoc. */&lt;BR /&gt;uri = step_uri;&lt;BR /&gt;rc = metadata_getnasn(uri, 'Transformations', 1, step_uri);&lt;/P&gt;&lt;P&gt;rc_s = metadata_getnasn(step_uri, 'ClassifierSources', 1, src_uri);&lt;BR /&gt;c=0;&lt;BR /&gt;do while(c &amp;lt;rc_s); /* Loop start- to obtain source table and its library name */&lt;BR /&gt;/* to reset all table name and their uri*/&lt;BR /&gt;src_lib_uri=""; src_lib_nm=""; src_uri=""; src_name="";&lt;BR /&gt;c=c+1;&lt;BR /&gt;rc = metadata_getnasn(step_uri, 'ClassifierSources', c, src_uri);&lt;BR /&gt;rc = metadata_getattr(src_uri, 'TableName', src_name);&lt;BR /&gt;if lengthn(src_name) =0 then rc = metadata_getattr(src_uri, 'SASTableName', src_name);&lt;BR /&gt;if lengthn(src_name) =0 then rc = metadata_getattr(src_uri, 'Name', src_name);&lt;BR /&gt;rc = metadata_getnasn(src_uri, 'TablePackage',1, src_lib_uri);&lt;BR /&gt;rc = metadata_getattr(src_lib_uri, 'Name',src_lib_nm);&lt;BR /&gt;if src_lib_nm ne '' then output;&lt;BR /&gt;end; /* Loop end- to obtain source table and its library name */&lt;/P&gt;&lt;P&gt;/* to reset all table name and their uri*/&lt;BR /&gt;src_lib_uri=""; src_lib_nm=""; src_uri=""; src_name="";&lt;/P&gt;&lt;P&gt;rc_t = metadata_getnasn(step_uri, 'ClassifierTargets', 1, tgt_uri);&lt;BR /&gt;c=0;&lt;/P&gt;&lt;P&gt;do while(c &amp;lt;rc_t); /* Loop start- to obtain target table and its library name */&lt;BR /&gt;/* to reset all table name and their uri*/&lt;BR /&gt;tgt_lib_uri=""; tgt_lib_nm=""; tgt_uri=""; tgt_name="";&lt;BR /&gt;c=c+1;&lt;BR /&gt;rc = metadata_getnasn(step_uri, 'ClassifierTargets', c, tgt_uri);&lt;BR /&gt;rc = metadata_getattr(tgt_uri, 'TableName', tgt_name);&lt;BR /&gt;if lengthn(tgt_name) =0 then rc = metadata_getattr(tgt_uri, 'SASTableName', tgt_name);&lt;BR /&gt;if lengthn(tgt_name) =0 then rc = metadata_getattr(tgt_uri, 'Name', tgt_name);&lt;BR /&gt;rc = metadata_getnasn(tgt_uri, 'TablePackage',1, tgt_lib_uri);&lt;BR /&gt;rc = metadata_getattr(tgt_lib_uri, 'Name',tgt_lib_nm);&lt;BR /&gt;if tgt_lib_nm ne '' then output;&lt;BR /&gt;end; /* Loop end- to obtain target table and its library name */&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;/* to reset all table name and their uri*/&lt;BR /&gt;tgt_lib_uri=""; tgt_lib_nm=""; tgt_uri=""; tgt_name="";&lt;/P&gt;&lt;P&gt;end; /*Loop end - to obtain all transfromation in a job */&lt;/P&gt;&lt;P&gt;end;/* Loop end- Determine how many jobs are on this repository and identify inputs &amp;amp; outputs. */&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2016 06:14:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/275301#M7708</guid>
      <dc:creator>RahulG</dc:creator>
      <dc:date>2016-06-06T06:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Metadata to get Dependent Objects</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/275303#M7709</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How about using the sas-relationship-reporter. Have a look at this blog entry &lt;A href="http://blogs.sas.com/content/sgf/2015/03/04/relationships-are-easy-for-sas-objects/" target="_blank"&gt;http://blogs.sas.com/content/sgf/2015/03/04/relationships-are-easy-for-sas-objects/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;More details on the relationship reporting tool can be found here &lt;A href="http://support.sas.com/documentation/cdl/en/bisag/68240/HTML/default/viewer.htm#p1dcleibglhr6wn19yzvfz81yw5y.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/bisag/68240/HTML/default/viewer.htm#p1dcleibglhr6wn19yzvfz81yw5y.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2016 06:20:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/275303#M7709</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-06-06T06:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Metadata to get Dependent Objects</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/275844#M7755</link>
      <description>Can we also add the column names in this report for each transformation ? E.g. Extract has 10 columns and also has new derived variable in output and I want to display that details as well. Need some guidance on this</description>
      <pubDate>Wed, 08 Jun 2016 02:27:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/275844#M7755</guid>
      <dc:creator>yashpande</dc:creator>
      <dc:date>2016-06-08T02:27:58Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Metadata to get Dependent Objects</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/275853#M7756</link>
      <description>&lt;P&gt;I have added a small loop to add TRANSFORMATION target table column name.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Source table column name not included yet as it will make the output dataset more bulky.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;col_cnt=0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;do while(col_cnt &amp;lt;rc_cols); &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;col_cnt=col_cnt+1;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;tgt_col_uri=""; tgt_col_nm="";&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rc = metadata_getnasn(tgt_uri, 'Columns',col_cnt, tgt_col_uri);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;rc = metadata_getattr(tgt_col_uri, 'Name',tgt_col_nm);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;output;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;end;&lt;/SPAN&gt;&lt;BR /&gt;**********************************************************&lt;BR /&gt;options metaserver="&amp;lt;server&amp;gt;"&lt;BR /&gt;metaport=8561&lt;BR /&gt;metaprotocol=bridge&lt;BR /&gt;metarepository="Foundation"&lt;BR /&gt;metauser=&amp;lt;user name&amp;gt;&lt;BR /&gt;metapass=&amp;lt;password&amp;gt;;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;data Job_input_output;&lt;BR /&gt;length job_name job_uri ctrl_order_uri step_uri step_name src_uri src_lib_uri tgt_lib_uri tree_uri jf_uri job_name src_name src_lib_nm tgt_uri tgt_name&lt;BR /&gt;tgt_lib_nm tgt_col_uri tgt_col_nm $256 ;&lt;BR /&gt;/* To initialize variables */ nobj = 1; n = 0;&lt;BR /&gt;keep job_name step_name src_name src_lib_nm tgt_name tgt_lib_nm lib_uri tgt_col_nm ;&lt;/P&gt;&lt;P&gt;do while(nobj &amp;gt;= 0 ); /* Loop start- Determine how many jobs are on this repository and identify inputs &amp;amp; outputs. */&lt;BR /&gt;n = n+1;&lt;BR /&gt;/* To get the number of jobs */&lt;BR /&gt;nobj = metadata_getnobj("omsobj:Job?@Name contains ''", n, job_uri);&lt;BR /&gt;put "nobj =" nobj "n = " n;&lt;BR /&gt;if n = 1 then do;&lt;BR /&gt;call symput('nobj', trim(left(nobj))); /* Number of Job objects found. */&lt;BR /&gt;if nobj lt 1 then do;&lt;BR /&gt;put 'Note: No Job objects found in this repository.';&lt;BR /&gt;stop;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;/* To get job name */&lt;BR /&gt;rc= metadata_getattr(job_uri,'Name',job_name);&lt;BR /&gt;rc= metadata_getattr(job_uri,'Name',job_name);&lt;BR /&gt;rc_jf = metadata_getnasn(job_uri, 'JFJobs', 1, jf_uri);&lt;BR /&gt;/* get the Custom association - control order */&lt;BR /&gt;rc = metadata_getnasn(job_uri, 'CustomAssociations', 1, ctrl_order_uri);&lt;BR /&gt;/*find out how many steps are associated */&lt;BR /&gt;n_steps = metadata_getnasn(ctrl_order_uri, 'AssociatedObjects', 1, step_uri);&lt;/P&gt;&lt;P&gt;do s = 1 to n_steps; /*Loop start - to obtain all transfromation in a job */&lt;/P&gt;&lt;P&gt;/* get details of each step*/&lt;BR /&gt;Transformation_step=s;&lt;BR /&gt;rc = metadata_getnasn(ctrl_order_uri, 'AssociatedObjects', s, step_uri);&lt;BR /&gt;rc = metadata_getattr(step_uri, 'Name', step_name);&lt;BR /&gt;/* for each Step, get the Transformations assoc. */&lt;BR /&gt;uri = step_uri;&lt;BR /&gt;rc = metadata_getnasn(uri, 'Transformations', 1, step_uri);&lt;BR /&gt;rc_s = metadata_getnasn(step_uri, 'ClassifierSources', 1, src_uri);&lt;BR /&gt;c=0;&lt;BR /&gt;do while(c &amp;lt;rc_s); /* Loop start- to obtain source table and its library name */&lt;BR /&gt;/* to reset all table name and their uri*/&lt;BR /&gt;src_lib_uri=""; src_lib_nm=""; src_uri=""; src_name="";&lt;BR /&gt;c=c+1;&lt;BR /&gt;rc = metadata_getnasn(step_uri, 'ClassifierSources', c, src_uri);&lt;BR /&gt;rc = metadata_getattr(src_uri, 'TableName', src_name);&lt;BR /&gt;if lengthn(src_name) =0 then rc = metadata_getattr(src_uri, 'SASTableName', src_name);&lt;BR /&gt;if lengthn(src_name) =0 then rc = metadata_getattr(src_uri, 'Name', src_name);&lt;BR /&gt;rc = metadata_getnasn(src_uri, 'TablePackage',1, src_lib_uri);&lt;BR /&gt;rc = metadata_getattr(src_lib_uri, 'Name',src_lib_nm);&lt;BR /&gt;/*if src_lib_nm ne '' then*/&lt;BR /&gt;output;&lt;BR /&gt;end; /* Loop end- to obtain source table and its library name */&lt;BR /&gt;/* to reset all table name and their uri*/&lt;BR /&gt;src_lib_uri=""; src_lib_nm=""; src_uri=""; src_name="";&lt;BR /&gt;rc_t = metadata_getnasn(step_uri, 'ClassifierTargets', 1, tgt_uri);&lt;BR /&gt;c=0;&lt;BR /&gt;do while(c &amp;lt;rc_t); /* Loop start- to obtain target table and its library name */&lt;BR /&gt;/* to reset all table name and their uri*/&lt;BR /&gt;tgt_lib_uri=""; tgt_lib_nm=""; tgt_uri=""; tgt_name="";&lt;BR /&gt;c=c+1;&lt;BR /&gt;rc = metadata_getnasn(step_uri, 'ClassifierTargets', c, tgt_uri);&lt;BR /&gt;rc = metadata_getattr(tgt_uri, 'TableName', tgt_name);&lt;BR /&gt;if lengthn(tgt_name) =0 then rc = metadata_getattr(tgt_uri, 'SASTableName', tgt_name);&lt;BR /&gt;if lengthn(tgt_name) =0 then rc = metadata_getattr(tgt_uri, 'Name', tgt_name);&lt;BR /&gt;rc = metadata_getnasn(tgt_uri, 'TablePackage',1, tgt_lib_uri);&lt;BR /&gt;rc = metadata_getattr(tgt_lib_uri, 'Name',tgt_lib_nm);&lt;BR /&gt;rc_cols = metadata_getnasn(tgt_uri, 'Columns',1, tgt_col_uri);&lt;BR /&gt;col_cnt=0;&lt;BR /&gt;do while(col_cnt &amp;lt;rc_cols);&lt;BR /&gt;col_cnt=col_cnt+1;&lt;BR /&gt;tgt_col_uri=""; tgt_col_nm="";&lt;BR /&gt;rc = metadata_getnasn(tgt_uri, 'Columns',col_cnt, tgt_col_uri);&lt;BR /&gt;rc = metadata_getattr(tgt_col_uri, 'Name',tgt_col_nm);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;if rc_cols&amp;lt;=0 then output;&lt;/P&gt;&lt;P&gt;end; /* Loop end- to obtain target table and its library name */&lt;/P&gt;&lt;P&gt;/* to reset all table name and their uri*/&lt;BR /&gt;tgt_lib_uri=""; tgt_lib_nm=""; tgt_uri=""; tgt_name="";&lt;BR /&gt;end; /*Loop end - to obtain all transfromation in a job */&lt;BR /&gt;end;/* Loop end- Determine how many jobs are on this repository and identify inputs &amp;amp; outputs. */&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you feel it helped you then mark it as Solution or give a like.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 03:29:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/275853#M7756</guid>
      <dc:creator>RahulG</dc:creator>
      <dc:date>2016-06-08T03:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Metadata to get Dependent Objects</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/276905#M7823</link>
      <description>This is perfect. However can you also help me in the report having source columns as well ? doesnt matter size of dataset</description>
      <pubDate>Mon, 13 Jun 2016 12:29:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/276905#M7823</guid>
      <dc:creator>yashpande</dc:creator>
      <dc:date>2016-06-13T12:29:50Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Metadata to get Dependent Objects</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/277114#M7830</link>
      <description>&lt;P&gt;Now I have added source column names as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;options metaserver="&amp;lt;server&amp;gt;"&lt;BR /&gt;metaport=8561&lt;BR /&gt;metaprotocol=bridge&lt;BR /&gt;metarepository="Foundation"&lt;BR /&gt;metauser=&amp;lt;user name&amp;gt;&lt;BR /&gt;metapass=&amp;lt;password&amp;gt;;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data Job_input_output;&lt;BR /&gt;length job_name job_uri ctrl_order_uri step_uri step_name src_uri src_lib_uri tgt_lib_uri tree_uri jf_uri job_name src_name src_lib_nm src_col_uri src_col_nm tgt_uri tgt_name&lt;BR /&gt;tgt_lib_nm tgt_col_uri tgt_col_nm $256 ;&lt;BR /&gt;/* To initialize variables */ nobj = 1; n = 0;&lt;BR /&gt;keep job_name step_name src_name src_lib_nm src_col_nm tgt_name tgt_lib_nm lib_uri tgt_col_nm ;&lt;BR /&gt;do while(nobj &amp;gt;= 0 ); /* Loop start- Determine how many jobs are on this repository and identify inputs &amp;amp; outputs. */&lt;BR /&gt;n = n+1;&lt;BR /&gt;/* To get the number of jobs */&lt;BR /&gt;nobj = metadata_getnobj("omsobj:Job?@Name contains ''", n, job_uri);&lt;BR /&gt;put "nobj =" nobj "n = " n;&lt;BR /&gt;if n = 1 then do;&lt;BR /&gt;call symput('nobj', trim(left(nobj))); /* Number of Job objects found. */&lt;BR /&gt;if nobj lt 1 then do;&lt;BR /&gt;put 'Note: No Job objects found in this repository.';&lt;BR /&gt;stop;&lt;BR /&gt;end;&lt;BR /&gt;end;&lt;BR /&gt;/* To get job name */&lt;BR /&gt;rc= metadata_getattr(job_uri,'Name',job_name);&lt;BR /&gt;rc= metadata_getattr(job_uri,'Name',job_name);&lt;BR /&gt;rc_jf = metadata_getnasn(job_uri, 'JFJobs', 1, jf_uri);&lt;BR /&gt;/* get the Custom association - control order */&lt;BR /&gt;rc = metadata_getnasn(job_uri, 'CustomAssociations', 1, ctrl_order_uri);&lt;BR /&gt;/*find out how many steps are associated */&lt;BR /&gt;n_steps = metadata_getnasn(ctrl_order_uri, 'AssociatedObjects', 1, step_uri);&lt;BR /&gt;do s = 1 to n_steps; /*Loop start - to obtain all transfromation in a job */&lt;BR /&gt;/* get details of each step*/&lt;BR /&gt;Transformation_step=s;&lt;BR /&gt;rc = metadata_getnasn(ctrl_order_uri, 'AssociatedObjects', s, step_uri);&lt;BR /&gt;rc = metadata_getattr(step_uri, 'Name', step_name);&lt;BR /&gt;/* for each Step, get the Transformations assoc. */&lt;BR /&gt;uri = step_uri;&lt;BR /&gt;rc = metadata_getnasn(uri, 'Transformations', 1, step_uri);&lt;BR /&gt;rc_s = metadata_getnasn(step_uri, 'ClassifierSources', 1, src_uri);&lt;BR /&gt;c=0;&lt;BR /&gt;do while(c &amp;lt;rc_s); /* Loop start- to obtain source table and its library name */&lt;BR /&gt;/* to reset all table name and their uri*/&lt;BR /&gt;src_lib_uri=""; src_lib_nm=""; src_uri=""; src_name="";&lt;BR /&gt;c=c+1;&lt;BR /&gt;rc = metadata_getnasn(step_uri, 'ClassifierSources', c, src_uri);&lt;BR /&gt;rc = metadata_getattr(src_uri, 'TableName', src_name);&lt;BR /&gt;if lengthn(src_name) =0 then rc = metadata_getattr(src_uri, 'SASTableName', src_name);&lt;BR /&gt;if lengthn(src_name) =0 then rc = metadata_getattr(src_uri, 'Name', src_name);&lt;BR /&gt;rc = metadata_getnasn(src_uri, 'TablePackage',1, src_lib_uri);&lt;BR /&gt;rc = metadata_getattr(src_lib_uri, 'Name',src_lib_nm);&lt;BR /&gt;rc_src_cols = metadata_getnasn(src_uri, 'Columns',1, src_col_uri);&lt;BR /&gt;src_col_cnt=0;&lt;BR /&gt;do while(src_col_cnt &amp;lt;rc_src_cols);&lt;BR /&gt;src_col_cnt=src_col_cnt+1;&lt;BR /&gt;src_col_uri=""; src_col_nm="";&lt;BR /&gt;rc = metadata_getnasn(src_uri, 'Columns',src_col_cnt, src_col_uri);&lt;BR /&gt;rc = metadata_getattr(src_col_uri, 'Name',src_col_nm);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;if rc_src_cols&amp;lt;=0 then output;&lt;BR /&gt;src_col_uri=""; src_col_nm="";&lt;BR /&gt;end; /* Loop end- to obtain source table and its library name */&lt;BR /&gt;/* to reset all table name and their uri*/&lt;BR /&gt;src_lib_uri=""; src_lib_nm=""; src_uri=""; src_name="";&lt;BR /&gt;rc_t = metadata_getnasn(step_uri, 'ClassifierTargets', 1, tgt_uri);&lt;BR /&gt;c=0;&lt;BR /&gt;do while(c &amp;lt;rc_t); /* Loop start- to obtain target table and its library name */&lt;BR /&gt;/* to reset all table name and their uri*/&lt;BR /&gt;tgt_lib_uri=""; tgt_lib_nm=""; tgt_uri=""; tgt_name="";&lt;BR /&gt;c=c+1;&lt;BR /&gt;rc = metadata_getnasn(step_uri, 'ClassifierTargets', c, tgt_uri);&lt;BR /&gt;rc = metadata_getattr(tgt_uri, 'TableName', tgt_name);&lt;BR /&gt;if lengthn(tgt_name) =0 then rc = metadata_getattr(tgt_uri, 'SASTableName', tgt_name);&lt;BR /&gt;if lengthn(tgt_name) =0 then rc = metadata_getattr(tgt_uri, 'Name', tgt_name);&lt;BR /&gt;rc = metadata_getnasn(tgt_uri, 'TablePackage',1, tgt_lib_uri);&lt;BR /&gt;rc = metadata_getattr(tgt_lib_uri, 'Name',tgt_lib_nm);&lt;BR /&gt;rc_cols = metadata_getnasn(tgt_uri, 'Columns',1, tgt_col_uri);&lt;BR /&gt;col_cnt=0;&lt;BR /&gt;do while(col_cnt &amp;lt;rc_cols);&lt;BR /&gt;col_cnt=col_cnt+1;&lt;BR /&gt;tgt_col_uri=""; tgt_col_nm="";&lt;BR /&gt;rc = metadata_getnasn(tgt_uri, 'Columns',col_cnt, tgt_col_uri);&lt;BR /&gt;rc = metadata_getattr(tgt_col_uri, 'Name',tgt_col_nm);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;if rc_cols&amp;lt;=0 then output;&lt;BR /&gt;tgt_col_uri=""; tgt_col_nm="";&lt;BR /&gt;end; /* Loop end- to obtain target table and its library name */&lt;BR /&gt;/* to reset all table name and their uri*/&lt;BR /&gt;tgt_lib_uri=""; tgt_lib_nm=""; tgt_uri=""; tgt_name="";&lt;BR /&gt;end; /*Loop end - to obtain all transfromation in a job */&lt;BR /&gt;end;/* Loop end- Determine how many jobs are on this repository and identify inputs &amp;amp; outputs. */&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do not forget to like the reply.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jun 2016 05:20:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/277114#M7830</guid>
      <dc:creator>RahulG</dc:creator>
      <dc:date>2016-06-14T05:20:43Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Metadata to get Dependent Objects</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/278355#M7864</link>
      <description>Superb. Thanks a ton</description>
      <pubDate>Sat, 18 Jun 2016 10:32:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/278355#M7864</guid>
      <dc:creator>yashpande</dc:creator>
      <dc:date>2016-06-18T10:32:54Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Metadata to get Dependent Objects</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/279393#M7912</link>
      <description>&lt;P&gt;Hello yashpande,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If one of the replies was the exact solution to your problem, can you please "Accept it as a solution"? Or if one was particularly helpful, feel free to "Like" it. This will help other community members who may run into the same issue know what worked.&lt;BR /&gt; &lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Laura&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jun 2016 15:29:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Proc-Metadata-to-get-Dependent-Objects/m-p/279393#M7912</guid>
      <dc:creator>lauralawton</dc:creator>
      <dc:date>2016-06-22T15:29:27Z</dc:date>
    </item>
  </channel>
</rss>

