SAS Data Integration Studio, DataFlux Data Management Studio, SAS/ACCESS, SAS Data Loader for Hadoop and others

Where are SAS DI jobs saved

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 85
Accepted Solution

Where are SAS DI jobs saved

Hi there,

We have structure like Folder--->Jobs------>Data . Out of this I can see data in folders but how to find the exact jobs on server. These data tables are registered by using Proc Metalib so I can view them  but how to find out if jobs are not registered.I need to list out the jobs. To be specific, is there any way to find out without creating the SPK ??? I hope that I am clear and making sense


Accepted Solutions
Solution
‎01-20-2012 06:00 AM
Occasional Contributor
Posts: 17

Re: Where are SAS DI jobs saved

Posted in reply to forumsguy

Look at proc metadata

%let xfile = %nrquote(<<Output XML FILE>>.xml);

filename myinput temp lrecl=256;

filename myoutput xfile lrecl=256;

options metapass="<<USERNAME>>"

        metaport=<<PORT>>

        metaprotocol=bridge

        metarepository="<<REPOSNAME>>"

        metaserver="<<METASERVERADDRESS>>"

        metauser="<<PASSWORD>>";

data _null_;

   file myinput;

   input;

   put _infile_ ' ';

   datalines;

<GetMetadataObjects>

<Reposid><<ID OF YOUR METADATA REPOSITORY>></Reposid>

<Type>Job</Type>

<Objects/>

<NS>SAS</NS>

<Flags>401</Flags>

<Options>

</Options>

</GetMetadataObjects>

;;

run;

proc metadata

   in=myinput   

   out=myoutput

   header=full;

run;    

Use the SAS XML Mapper to create a .map file and save it.  After that, issue a libname statement using the xml libname engine.  This creates a library which you can query like any other sas datasets.  I've attached a default map for you.

filename mymap = %nrquote(<<FILENAME and PATH of MAP FILE>>);

libname xfile xml xmlmap=mymap;

This will return all jobs.  If you need Deployed Jobs, replace the Type in the GetMetadataObjects with the type of "JFJob".  You can also use filters in GetMetadata to only show jobs with the ID's you mentioned.  Details are on support.sas.com. 

Cam

View solution in original post

Attachment

All Replies
Occasional Contributor
Posts: 17

Where are SAS DI jobs saved

Posted in reply to forumsguy

Unless you deploy the job for scheduling the job is defined in the SAS metadata server and not in a physical drive.  That means the job structure is stored in tables as opposed to .sas files like you would in base/SAS or EG etc.  If you need to view job definitions you need to either query the metadata server using metadata functions or proc metadata.  If you have deployed your job for scheduling then the job defaults generally to your sas config directory under batch jobs.

Frequent Contributor
Posts: 85

Where are SAS DI jobs saved

Thanks a lor CameronL .... One more question... can u help me out in printing job names in Enterprise guide ... See I have jobs with Ids as A35467U.12G,A35467U.169 and A35467U.144 .. how do I print the corresponding object name in Base SAS ... I know getattr function can be used here but how to is something I am really confused.. can u plz show some direction

Solution
‎01-20-2012 06:00 AM
Occasional Contributor
Posts: 17

Re: Where are SAS DI jobs saved

Posted in reply to forumsguy

Look at proc metadata

%let xfile = %nrquote(<<Output XML FILE>>.xml);

filename myinput temp lrecl=256;

filename myoutput xfile lrecl=256;

options metapass="<<USERNAME>>"

        metaport=<<PORT>>

        metaprotocol=bridge

        metarepository="<<REPOSNAME>>"

        metaserver="<<METASERVERADDRESS>>"

        metauser="<<PASSWORD>>";

data _null_;

   file myinput;

   input;

   put _infile_ ' ';

   datalines;

<GetMetadataObjects>

<Reposid><<ID OF YOUR METADATA REPOSITORY>></Reposid>

<Type>Job</Type>

<Objects/>

<NS>SAS</NS>

<Flags>401</Flags>

<Options>

</Options>

</GetMetadataObjects>

;;

run;

proc metadata

   in=myinput   

   out=myoutput

   header=full;

run;    

Use the SAS XML Mapper to create a .map file and save it.  After that, issue a libname statement using the xml libname engine.  This creates a library which you can query like any other sas datasets.  I've attached a default map for you.

filename mymap = %nrquote(<<FILENAME and PATH of MAP FILE>>);

libname xfile xml xmlmap=mymap;

This will return all jobs.  If you need Deployed Jobs, replace the Type in the GetMetadataObjects with the type of "JFJob".  You can also use filters in GetMetadata to only show jobs with the ID's you mentioned.  Details are on support.sas.com. 

Cam

Attachment
Frequent Contributor
Posts: 85

Where are SAS DI jobs saved

Thanks a lot... it solved the purpose...

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 628 views
  • 0 likes
  • 2 in conversation