So you have an idea to implement queries or changes in the metadata via a program directly using SAS. Well, one of the first items of business is actually to grab the Repository ID number. Included below is some quick reference code on how to query that.
PROC METADATA SERVER="my_sas_srv_name" PORT=8561 USERID="sasadm@saspw" PASSWORD="xxxxxxxx" PROTOCOL=BRIDGE
in="<GetRepositories>
<Repositories/>
<Flags></Flags>
<Options/>
</GetRepositories>";
run;