BookmarkSubscribeRSS Feed
AnjaliNair
Calcite | Level 5

Hello All,

 

I want to extract the following execution property of a Stored Process.

SP.png

 

I have tried Proc STP; list group=executtion; run; but could only get the following properties:SP.png

 

How can I find out the server type on which the SP is to be executed?

 

Note: I want to produce a SAS data set listing all properties of SAS Stored Process, including the above property I mentioned.

 

Thanks in Advance,

Anjali

4 REPLIES 4
AllanBowe
Barite | Level 11

Here you go:

 


%let path_to_my_stp="/some/path/mySTP";

data _null_;
  length uri type serveruri $256.;
  path="&path_to_my_stp";
  if metadata_pathobj("",path,"StoredProcess",type,uri)>0 then 
    call symputx('uri',uri);
run;

data associations;
  keep assoc assocuri name;
  length assoc assocuri name $256;
  rc1=1;n1=1;
  do while(rc1>0);
    /* Walk through all possible associations of this object. */
    rc1=metadata_getnasl("&uri",n1,assoc);
    rc2=1;n2=1;
    do while(rc2>0);
      /* Walk through all the associations on this machine object. */
      rc2=metadata_getnasn("&uri",trim(assoc),n2,assocuri);
      if (rc2>0) then do;
        rc3=metadata_getattr(assocuri,"Name",name);
        output;
      end;
      call missing(name,assocuri);
      put arc= rc2=;
      n2+1;
    end;
    n1+1;
  end;
run;
proc sort data=associations;
  by assoc name;
run;


data attrprop;
  keep type name value;
  length type $4 name $256 value $32767;
  rc1=1;n1=1;type='Prop';
  do while(rc1>0);
    rc1=metadata_getnprp("&uri",n1,name,value);
    if rc1>0 then output;
    n1+1;
  end;
  rc1=1;n1=1;type='Attr';
  do while(rc1>0);
    rc1=metadata_getnatr("&uri",n1,name,value);
    if rc1>0 then output;
    n1+1;
  end;
run;
proc sort data=attrprop;
  by type name;
run;

By the way - the above code was taken from our free SAS 9 web application for exploring metadata - you can check it out and deploy it yourself, it's the web equivalent of METABROWSE:  https://github.com/Boemska/metanav

 

On the off-chance that you're extracting all these details so you can make your own STP, programmatically - let me save you some time:

 

https://github.com/sasjs/core/blob/main/meta/mm_createstp.sas

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs
AnjaliNair
Calcite | Level 5

Hello Allan,

 

Thank you so much for your quick reply.

 

I executed the provided code, it is giving me all properties except the one I mentioned, which is to see the how a particular stored process is configured to execute on which server - Workspace, SP or default.

 

Thanks in Advance,

Anjali

AllanBowe
Barite | Level 11

I suggest deploying the metanav application to see how to extract this info:  https://github.com/Boemska/metanav

 

/Allan
SAS Challenges - SASensei
MacroCore library for app developers
SAS networking events (BeLux, Germany, UK&I)

Data Workflows, Data Contracts, Data Lineage, Drag & drop excel EUCs to SAS 9 & Viya - Data Controller
DevOps and AppDev on SAS 9 / Viya / Base SAS - SASjs
Vince_SAS
Rhodochrosite | Level 12

You can try running this using PROC HTTP, and then use DATA step code to parse the HTML that is returned:

 

http://server:port/SASStoredProcess/guest?_debug=list

 

It provides some of the properties of all stored processes on the system.  Execute the URL using a Web browser to see the properties that are returned.

 

Vince DelGobbo

SAS R&D

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 936 views
  • 0 likes
  • 3 in conversation