<?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: Extract Scheduled Jobs from SMC in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/757119#M1242</link>
    <description>&lt;P&gt;This is exactly what I needed, thank you! Do you know if I can pull the actual schedule also? Ex: Run 1x Daily at 5am.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jul 2021 12:45:25 GMT</pubDate>
    <dc:creator>zdeb15</dc:creator>
    <dc:date>2021-07-27T12:45:25Z</dc:date>
    <item>
      <title>Extract Scheduled Jobs from SMC</title>
      <link>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/573935#M468</link>
      <description>&lt;P&gt;I am trying to monitor scheduled jobs in SAS Management Console (SMC). I understand there are dictionaries to pull metadata libraries, views, tables, etc.... ...Is there something similar to pull scheduled Jobs / stored proc?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jul 2019 16:47:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/573935#M468</guid>
      <dc:creator>zdeb15</dc:creator>
      <dc:date>2019-07-16T16:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Scheduled Jobs from SMC</title>
      <link>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/580530#M473</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you will use the LSF then you will get a good insight of the same and you can run the below code also to get the scheduled flows. Yes, it's obvious that you need to change the path... or else try to look for something in SMC installation folder and try to replicate the same code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
/*Set this value to the location of your Platform Process Manager installation folder*/
%let pm_install_loc = /sasconfig/pm;

/*Scheduled Flows information. This file seems to be updated by LSF/PM every day at midnight*/
DATA SCHEDULED_FLOWS;
	INFILE "&amp;amp;pm_install_loc./work/system/triggerevents.dat" DSD TRUNCOVER;
	LENGTH TEXT $512. FLOW_OWNER $10. FLOW_NAME $64.;
	INPUT @1 TEXT;	
	IF FIND(TEXT,":") THEN DO;
		FLOW_OWNER = SCAN(TEXT,1,":");	
		FLOW_NAME = SCAN(TEXT,2,":");
	END;
	IF NOT MISSING(FLOW_NAME);
RUN;

/*Flow Information. These files are updated any time a flow is scheduled/rescheduled in SMC or Flow Manager*/
FILENAME XCMD PIPE "ls -ltr &amp;amp;pm_install_loc./work/storage/flow_storage";

/*Create dataset of output from X command*/
DATA FLOW_STORAGE;
	INFILE XCMD DSD TRUNCOVER;
	LENGTH TEXT LOG FILEPATH $512.;
	INPUT @1 TEXT;		
	LOG = SCAN(TEXT,-1," ");	
	IF FIND(TEXT,".dat");
	FILEPATH = "&amp;amp;pm_install_loc./work/storage/flow_storage/"||STRIP(LOG);
	FLOW_OWNER = SCAN(LOG,1,":");
	FLOW_NAME = SCAN(SCAN(LOG,2,":"),1,"%");
	/*Ensuring that only root directory is included in output*/	
	DROP TEXT;
RUN;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bcoz as of my knowledge I think under the scheduled manager list in SMC, we use to see all the flows which are scheduled, so if you need something else then please explain.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 12:57:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/580530#M473</guid>
      <dc:creator>rajdeep</dc:creator>
      <dc:date>2019-08-12T12:57:42Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Scheduled Jobs from SMC</title>
      <link>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/709627#M1081</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13220"&gt;@rajdeep&lt;/a&gt;Is it also possible to list the type of the trigger in the output list and last modified date of the flow ?&lt;/P&gt;</description>
      <pubDate>Wed, 06 Jan 2021 14:43:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/709627#M1081</guid>
      <dc:creator>sergie89</dc:creator>
      <dc:date>2021-01-06T14:43:17Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Scheduled Jobs from SMC</title>
      <link>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/745083#M1187</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I think rajdeep has pointed you in the direction of the information you are after.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll just add a general comment to your question which I interpret as asking is there a way of getting schedule etc information from Metadata?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I haven't attempted to get Job/Deployed Job/Flow etc related metadata, but I have read and written other metadata objects:&lt;/P&gt;
&lt;P&gt;Yes, you can read and write metadata programmatically.&amp;nbsp; I wouldn't say it's easy and it takes a bit to get your head around the metadata model.&lt;/P&gt;
&lt;P&gt;If you are wanting to access metadata objects, take a look at these documents:&lt;/P&gt;
&lt;P&gt;Metadata Model Reference: &lt;A href="https://support.sas.com/documentation/cdl/en/omamodref/67417/HTML/default/viewer.htm#titlepage.htm" target="_blank"&gt;https://support.sas.com/documentation/cdl/en/omamodref/67417/HTML/default/viewer.htm#titlepage.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SAS Language interfaces to metadata &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrmeta/titlepage.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrmeta/titlepage.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 06:04:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/745083#M1187</guid>
      <dc:creator>MarkBodt_NZ</dc:creator>
      <dc:date>2021-06-02T06:04:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Scheduled Jobs from SMC</title>
      <link>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/756533#M1240</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I think you can use the below set of codes to find all Metadata Jobs as well as STPs list. Yeah, if you want any specific metadata folder jobs or STP then have to pass the Type and Attribute variable according to that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For Jobs:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.JOBlist(drop=_: label="SAS JOB List" rename=(name=Job_Name)) ;
  length id $17 _uri name description _modified _created location _location $256;
  length created modified 8;
  format created modified datetime.;
  label id="Metadata ID"
        name="JOB Name"
        description="Description"
        location="Folder Location"
        created="Created"
        modified="Last Modified";
  _nobj=1;
  _n=1;
  call missing(id, _uri, name, description, _modified, _created, _location);
 
  do while(_n le _nobj);
    _nobj=metadata_getnobj("omsobj:Job?@Id contains '.'",_n,_uri);

    _rc=metadata_getattr(_uri,"Id",id);
    _rc=metadata_getattr(_uri,"Name",name);
    _rc=metadata_getattr(_uri,"Desc",description);
    _rc=metadata_getattr(_uri,"MetadataCreated",_created);
    _rc=metadata_getattr(_uri,"MetadataUpdated",_modified);
 
    created=input(_created,anydtdtm.);
    modified=input(_modified,anydtdtm.);
 
    * Get folder object the current JOB is in *;
    _rc=metadata_getnasn(_uri,"Trees",1,_uri);
    * Get folder name the current JOB is in *;
    _rc=metadata_getattr(_uri,"Name",location);
    _tree=1;
    * Loop up the folder hierarchy *;
    do while (_tree&amp;gt;0);
      * Get the parent folder object *;
      _tree=metadata_getnasn(_uri,"ParentTree",1,_uri);
      if _tree &amp;gt; 0 then do;
        * If there was a parent folder, get the name *;
        _rc=metadata_getattr(_uri,"Name",_location);
        * Construct the path *;
        location=catx('/',_location,location);
      end;
    end; * Folder Hierachy *;
     location = '/'||location;
    output;
    _n=_n+1;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For STPs:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data work.stplist(drop=_: label="SAS Stored Process List");
  length id $17 _uri name description _modified _created location _location $256;
  length created modified 8;
  format created modified datetime.;
  label id="Metadata ID"
        name="Stored Process Name"
        description="Description"
        location="Folder Location"
        created="Created"
        modified="Last Modified";
  _nobj=1;
  _n=1;
  call missing(id, _uri, name, description, _modified, _created, _location);
 
  do while(_n le _nobj);
    _nobj=metadata_getnobj("omsobj:ClassifierMap?@PublicType='StoredProcess'",_n,_uri);
    _rc=metadata_getattr(_uri,"Id",id);
    _rc=metadata_getattr(_uri,"Name",name);
    _rc=metadata_getattr(_uri,"Desc",description);
    _rc=metadata_getattr(_uri,"MetadataCreated",_created);
    _rc=metadata_getattr(_uri,"MetadataUpdated",_modified);
 
    created=input(_created,anydtdtm.);
    modified=input(_modified,anydtdtm.);
 
    * Get folder object the current STP is in *;
    _rc=metadata_getnasn(_uri,"Trees",1,_uri);
    * Get folder name the current STP is in *;
    _rc=metadata_getattr(_uri,"Name",location);
    _tree=1;
    * Loop up the folder hierarchy *;
    do while (_tree&amp;gt;0);
      * Get the parent folder object *;
      _tree=metadata_getnasn(_uri,"ParentTree",1,_uri);
      if _tree &amp;gt; 0 then do;
        * If there was a parent folder, get the name *;
        _rc=metadata_getattr(_uri,"Name",_location);
        * Construct the path *;
        location=catx('/',_location,location);
      end;
    end; * Folder Hierachy *;
     location = '/'||location;
     output;
    _n=_n+1;
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 25 Jul 2021 21:01:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/756533#M1240</guid>
      <dc:creator>rajdeep</dc:creator>
      <dc:date>2021-07-25T21:01:11Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Scheduled Jobs from SMC</title>
      <link>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/756583#M1241</link>
      <description>&lt;P&gt;Yes - there's a macro for it in the &lt;A href="https://github.com/sasjs/core" target="_self"&gt;SASjs/core&lt;/A&gt; library:&amp;nbsp;&amp;nbsp;&lt;A href="https://core.sasjs.io/mm__tree_8sas.html" target="_blank"&gt;https://core.sasjs.io/mm__tree_8sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To fetch all Deployed Jobs and STPs in one go:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* load macros */
filename mc url  "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
%inc mc;

/* export only jobs and STPs */
%mm_tree(root=/
  ,types=DeployedJob StoredProcess
  ,outds=work.mycontent
)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 26 Jul 2021 07:50:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/756583#M1241</guid>
      <dc:creator>AllanBowe</dc:creator>
      <dc:date>2021-07-26T07:50:20Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Scheduled Jobs from SMC</title>
      <link>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/757119#M1242</link>
      <description>&lt;P&gt;This is exactly what I needed, thank you! Do you know if I can pull the actual schedule also? Ex: Run 1x Daily at 5am.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 12:45:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/757119#M1242</guid>
      <dc:creator>zdeb15</dc:creator>
      <dc:date>2021-07-27T12:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Scheduled Jobs from SMC</title>
      <link>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/757126#M1243</link>
      <description>Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13220"&gt;@rajdeep&lt;/a&gt; ,&lt;BR /&gt;&lt;BR /&gt;Thanks for your response. Is it also possible to this for the scheduled flows ?</description>
      <pubDate>Tue, 27 Jul 2021 13:23:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/757126#M1243</guid>
      <dc:creator>sergie89</dc:creator>
      <dc:date>2021-07-27T13:23:55Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Scheduled Jobs from SMC</title>
      <link>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/757133#M1244</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A class="trigger-hovercard" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/192219" target="_blank" rel="noopener"&gt;sergie89&lt;/A&gt;,&lt;/P&gt;
&lt;P&gt;The code what I posted above was for all jobs that are available in Metadata, but if you need the list for only Deployed jobs or any flow if you had scheduled in SMC over Metadata then you just need to change the below from the above code.&lt;/P&gt;
&lt;P&gt;_nobj=metadata_getnobj("omsobj:JOB?@Id contains '.'",_n,_uri);&lt;/P&gt;
&lt;P&gt;TO&lt;/P&gt;
&lt;P&gt;_nobj=metadata_getnobj("omsobj:JFJOB?@Id contains '.'",_n,_uri);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try that, I think it will just list out the flow names and deployed jobs. If anything else let me know I will also try.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 14:31:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/757133#M1244</guid>
      <dc:creator>rajdeep</dc:creator>
      <dc:date>2021-07-27T14:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Scheduled Jobs from SMC</title>
      <link>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/757137#M1245</link>
      <description>&lt;P&gt;This works but more particular I am looking for the information related to the flow, under scheduler manager option in SAS Management Console. I am thinking since this information gets stored in windows task manager, I would have to link the and the flow to the scheduled tasks from task manager? I am not 100% sure if this is stored in metadata.&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;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="zdeb15_0-1627396346000.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/61902i6A4F5DB1A47CD930/image-size/medium?v=v2&amp;amp;px=400" role="button" title="zdeb15_0-1627396346000.png" alt="zdeb15_0-1627396346000.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 14:33:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/757137#M1245</guid>
      <dc:creator>zdeb15</dc:creator>
      <dc:date>2021-07-27T14:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Scheduled Jobs from SMC</title>
      <link>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/757138#M1246</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;A class="trigger-hovercard" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/272807" target="_blank"&gt;zdeb15,&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just want to know which flow manager you are using for your environment to schedule the jobs. If it's LSF then I have posted the code related to it in the past reply chain.&lt;/P&gt;
&lt;P&gt;Also, please let me know what you need as an output table columns exactly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jul 2021 14:35:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/757138#M1246</guid>
      <dc:creator>rajdeep</dc:creator>
      <dc:date>2021-07-27T14:35:42Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Scheduled Jobs from SMC</title>
      <link>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/757157#M1247</link>
      <description>Hi  zdeb15,&lt;BR /&gt;&lt;BR /&gt;I would suggest go to the C:\Windows\System32\Tasks directory, there you can retrieve the schedule details regarding the flows from SMC.&lt;BR /&gt;Yeah, it will be a XML version file, but through a small program we can pull the required parameters and it's values into a structured fashion.&lt;BR /&gt;&lt;BR /&gt;From metadata information point of view I tried, but it seems timeline and interval related attributes are not getting stored inside Metadata. But if I get any info regarding this will post here.&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Tue, 27 Jul 2021 15:49:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/757157#M1247</guid>
      <dc:creator>rajdeep</dc:creator>
      <dc:date>2021-07-27T15:49:48Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Scheduled Jobs from SMC</title>
      <link>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/830963#M6144</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;&lt;SPAN&gt;I am looking for the information related to the flow, under scheduler manager option in SAS Management Console.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Were you ever able to find this information in metadata?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Aug 2022 18:04:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Extract-Scheduled-Jobs-from-SMC/m-p/830963#M6144</guid>
      <dc:creator>kevin_stanford</dc:creator>
      <dc:date>2022-08-29T18:04:09Z</dc:date>
    </item>
  </channel>
</rss>

