Hi @FrankPoppe,
It can also be retrieved using SAS code and by making use of the functions as indicated by the OP.
Please find below some sample code to retrieve the information
data work.job_metadata
(keep=
job_counter job_name job_publictype job_id job_uri job_checkvalue
pst_counter pst_name pst_id pst_uri pst_checkvalue
stp_counter stp_name stp_pname stp_defval stp_id stp_uri stp_checkvalue
);
length
job_name $128
job_publictype $16
job_id $32
job_uri $256
pst_name $128
pst_id $32
pst_uri $256
stp_name $128
stp_pname $256
stp_defval $32767
stp_id $32
stp_uri $256
job_checkvalue $2
job_counter 8
job_retcode 8
pst_checkvalue $2
pst_counter 8
pst_retcode 8
stp_checkvalue $2
stp_counter 8
stp_retcode 8
attribute_retcode 8
;
call missing (of _all_);
job_counter = 1;
job_retcode = metadata_getnobj("omsobj:Job?@Id contains '.'",job_counter,job_uri);
if (job_retcode<=0) then do;
call missing(job_name,job_publictype,job_id);
job_checkvalue = 'NG';
output;
end;
else do;
do while (job_retcode>0);
job_checkvalue = 'OK';
attribute_retcode = metadata_getattr(job_uri,"Id",job_id);
attribute_retcode = metadata_getattr(job_uri,"Name",job_name);
attribute_retcode = metadata_getattr(job_uri,"PublicType",job_publictype);
pst_counter = 1;
pst_retcode = metadata_getnasn(job_uri,"PropertySets",pst_counter,pst_uri);
if (pst_retcode<=0) then do;
call missing(pst_name,pst_id);
pst_checkvalue = 'NG';
output;
end;
else do;
do while (pst_retcode>0);
pst_checkvalue = 'OK';
attribute_retcode = metadata_getattr(pst_uri,"Id",pst_id);
attribute_retcode = metadata_getattr(pst_uri,"Name",pst_name);
if (pst_name='USERPROPERTIES') then do;
stp_counter = 1;
stp_retcode = metadata_getnasn(pst_uri,"SetProperties",stp_counter,stp_uri);
if (stp_retcode<=0) then do;
call missing(stp_name,stp_id);
stp_checkvalue = 'NG';
output;
end;
else do;
do while (stp_retcode>0);
stp_checkvalue = 'OK';
attribute_retcode = metadata_getattr(stp_uri,"Id",stp_id);
attribute_retcode = metadata_getattr(stp_uri,"Name",stp_name);
attribute_retcode = metadata_getattr(stp_uri,"PropertyName",stp_pname);
attribute_retcode = metadata_getattr(stp_uri,"DefaultValue",stp_defval);
if (stp_pname='DiagramXML' and index(stp_defval,'StickyNoteNode')>0) then output;
stp_counter + 1;
stp_retcode = metadata_getnasn(pst_uri,"SetProperties",stp_counter,stp_uri);
end;
end;
end;
pst_counter + 1;
pst_retcode = metadata_getnasn(job_uri,"PropertySets",pst_counter,pst_uri);
end;
end;
job_counter + 1;
job_retcode = metadata_getnobj("omsobj:Job?@Id contains '.'",job_counter,job_uri);
end;
end;
run;
From this dataset the sticky note text can be retrieved from the stp_defval column.
Please find below a simple example for this (I am sure more fancy ways can be thought of):
data work.stickynotes_tags (keep=job_id job_name stp_id stickynote_tag text_tag);
set work.job_metadata;
length stickynote_tag text_tag $4096;
/* This may need to be repeated in case there is more than one sticky note */
stickynote_tag = substr(stp_defval,index(stp_defval,'<StickyNoteNode>')+16);
stickynote_tag = substr(stickynote_tag,1,index(stickynote_tag,'</StickyNoteNode>')-1);
text_tag = substr(stickynote_tag,index(stickynote_tag,'<Text>')+6);
text_tag = substr(text_tag,1,index(text_tag,'</Text>')-1);
run;
... View more