i have some stored processes with identical names. To identify which process is running at the moment, i need to know the id of the stored process in the metadata. Can i retrieve the STP-id somewhere? I could not find a variable which holds the id. I only found symget('sysjobid'); which returns the unix-processid, not the id of the stored process.
Typical a stored process id looks like this: A5DF0R0G.B80001L7
I need to know the id from within the process which is running, to retrieve some properties of the process from the metadata.
Any other solution to identify the process exactly in the metadata would also be welcome, but i can not use his name, because it can occur several times for differents processes.
for example something like:
put 'name:' &_program; /*this already works and returns the name of the stored process*/
put 'id:' ?; /*need to know the id of the process, because name is not distinct*/
It is actually pretty easy now that I look at it.
I created this sample STP (named "Doms Hello World") in the "My Folder" folder.
data _temp;
X = "HELLO WORLD";
path = "&_PROGRAM";
format type ID $200.;
rc= metadata_pathobj("",path,"StoredProcess",type,ID);
run;
proc print data=_temp noobs;
run;
You can use the metadata_pathobj()
function to get the ID and TYPE of an element by the path.
This returns
X path type ID rc
HELLO WORLD /User Folders/dpazzula/My Folder/Doms Hello World ClassifierMap A5XQ9K3Z.BA0002BQ 1
In both EG and via the Web App.