<?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: How to get source file path for deployed job in Administration and Deployment</title>
    <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-get-source-file-path-for-deployed-job/m-p/743983#M22225</link>
    <description>&lt;P&gt;This program could help:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Edit with connection information for the Metadata Server. */

options metaserver="meta.demo.sas.com"
		metaport=8561
		metauser="sasadm@saspw"
		metapass="password"
		metarepository=Foundation
		metaprotocol=bridge;

/* End Edit. */

data source;

	keep job_name source; /* Retain only the job name and it's source code full path. */

/* Initialize variables. */

	length type id job_uri job_name file_uri file_name dir_uri path $ 50; 
	call missing (of _character_);

	obj="omsobj:Job?@Id contains '.'"; /* Search criteria for Jobs. */

	job_count=metadata_resolve(obj,type,id); /* Count all jobs. Only run loop if jobs exist. */

	if job_count &amp;gt; 0 then do i=1 to job_count; /* Loop: For each job found, get attributes and associations. */
		rc=metadata_getnobj(obj,i,job_uri);
		rc=metadata_getattr(job_uri,"Name",job_name); /* Get job name. */
		rc=metadata_getnasn(job_uri,"SourceCode",1,file_uri); /* Get file Metadata object id.  */
		rc=metadata_getattr(file_uri,"Name",file_name); /* Get file name. */
		rc=metadata_getnasn(file_uri,"Directories",1,dir_uri); /* Get directory Metadata object id.  */
		rc=metadata_getattr(dir_uri,"DirectoryName",path); /* Get path to directory. */
		source=catx('/',path,file_name); /* combine directory path and file name to create full path to file.*/
		output;
	end; /* End loop. */
	else put "WARN: No jobs found in Metadata."; /* If no jobs are found, write a message to the log. */
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 26 May 2021 18:06:39 GMT</pubDate>
    <dc:creator>gwootton</dc:creator>
    <dc:date>2021-05-26T18:06:39Z</dc:date>
    <item>
      <title>How to get source file path for deployed job</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-get-source-file-path-for-deployed-job/m-p/743975#M22222</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;In SAS management console we have the option to "Deploy SAS datastep program"&lt;BR /&gt;while deploying we choose the "Source File" location where the source sas code currently resides.&lt;BR /&gt;&lt;BR /&gt;when we redeploy the job it picks up the updated code from the "Source File" location and deploys the job.&lt;BR /&gt;&lt;BR /&gt;My question is , is there i way i can find out what was the Source File location of a deployed job ?&lt;BR /&gt;&lt;BR /&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 17:43:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-get-source-file-path-for-deployed-job/m-p/743975#M22222</guid>
      <dc:creator>NN</dc:creator>
      <dc:date>2021-05-26T17:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to get source file path for deployed job</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-get-source-file-path-for-deployed-job/m-p/743982#M22224</link>
      <description>&lt;P&gt;Please have a look at this paper.&lt;BR /&gt;It will answer your questions and more&amp;nbsp;&lt;A href="https://www.aii-3.com/wp-content/uploads/2020/02/Schedule-SAS-Jobs-Using-Schedule-Manager.pdf" target="_blank"&gt;https://www.aii-3.com/wp-content/uploads/2020/02/Schedule-SAS-Jobs-Using-Schedule-Manager.pdf&lt;/A&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 26 May 2021 18:03:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-get-source-file-path-for-deployed-job/m-p/743982#M22224</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-05-26T18:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to get source file path for deployed job</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-get-source-file-path-for-deployed-job/m-p/743983#M22225</link>
      <description>&lt;P&gt;This program could help:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Edit with connection information for the Metadata Server. */

options metaserver="meta.demo.sas.com"
		metaport=8561
		metauser="sasadm@saspw"
		metapass="password"
		metarepository=Foundation
		metaprotocol=bridge;

/* End Edit. */

data source;

	keep job_name source; /* Retain only the job name and it's source code full path. */

/* Initialize variables. */

	length type id job_uri job_name file_uri file_name dir_uri path $ 50; 
	call missing (of _character_);

	obj="omsobj:Job?@Id contains '.'"; /* Search criteria for Jobs. */

	job_count=metadata_resolve(obj,type,id); /* Count all jobs. Only run loop if jobs exist. */

	if job_count &amp;gt; 0 then do i=1 to job_count; /* Loop: For each job found, get attributes and associations. */
		rc=metadata_getnobj(obj,i,job_uri);
		rc=metadata_getattr(job_uri,"Name",job_name); /* Get job name. */
		rc=metadata_getnasn(job_uri,"SourceCode",1,file_uri); /* Get file Metadata object id.  */
		rc=metadata_getattr(file_uri,"Name",file_name); /* Get file name. */
		rc=metadata_getnasn(file_uri,"Directories",1,dir_uri); /* Get directory Metadata object id.  */
		rc=metadata_getattr(dir_uri,"DirectoryName",path); /* Get path to directory. */
		source=catx('/',path,file_name); /* combine directory path and file name to create full path to file.*/
		output;
	end; /* End loop. */
	else put "WARN: No jobs found in Metadata."; /* If no jobs are found, write a message to the log. */
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 26 May 2021 18:06:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-get-source-file-path-for-deployed-job/m-p/743983#M22225</guid>
      <dc:creator>gwootton</dc:creator>
      <dc:date>2021-05-26T18:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to get source file path for deployed job</title>
      <link>https://communities.sas.com/t5/Administration-and-Deployment/How-to-get-source-file-path-for-deployed-job/m-p/744007#M22228</link>
      <description>Thank you this definitely helps.</description>
      <pubDate>Wed, 26 May 2021 19:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Administration-and-Deployment/How-to-get-source-file-path-for-deployed-job/m-p/744007#M22228</guid>
      <dc:creator>NN</dc:creator>
      <dc:date>2021-05-26T19:13:14Z</dc:date>
    </item>
  </channel>
</rss>

