3

In SAS Open Metadata reference (page 126), it says: The UpdateMetadata method enables you to update the properties of existing metadata objects. It returns an error if the metadata object to be updated does not exist, unless the OMI_IGNORE_NOTFOUND (134217728) flag is set.

Here is my problem, if I specify the flag or I don't specify the flag, I still get the same error: ("SASLibrary : A5X8AHW1.B40000SQ cannot be found in the wlibrary container in the Foundation repository.")

Here is a snippet that reproduces the error:

import com.sas.meta.SASOMI.IOMI;
import com.sas.metadata.MetadataUtil;
import org.omg.CORBA.StringHolder;

IOMI iOMI = ... // an instance of IOMI connection

StringHolder outputMeta = new StringHolder();

String request = ""
        + "<UpdateMetadata>"
        + "   <Metadata>"
        + "     <SASLibrary Id=\"A5X8AHW1.B40000SQ\"/>"
        + "   </Metadata>"
        + "   <NS>SAS</NS>"
        + "   <Flags>" + (MetadataUtil.OMI_IGNORE_NOTFOUND | MetadataUtil.OMI_TRUSTED_CLIENT | MetadataUtil.OMI_RETURN_LIST) + "</Flags>"
        + "   <Options/>"
        + "</UpdateMetadata>"
        ;

iOMI.DoRequest(request, outputMeta);

Any ideas what is going wrong?

Allan Bowe
  • 12,306
  • 19
  • 75
  • 124
Vasilij Nevlev
  • 1,449
  • 9
  • 22
  • Any following the breadcrumbs, more information is on here: https://communities.sas.com/t5/Administration-and-Deployment/Use-of-OMI-IGNORE-NOTFOUND-flag-in-SAS-OpenMetadata-interface/m-p/374600/ – Vasilij Nevlev Jul 12 '17 at 05:52

1 Answers1

2

Contrary to what that document states, I have only seen OMI_IGNORE_NOTFOUND flag work with the DeleteMetadata method.

The javadoc also seems to support this by stating

OMI_IGNORE_NOTFOUND (134217728) This flag is for DeleteMetadata to tell it to ignore objects not found so that it will not return on error.

com.sas.metadata.remote.MdOMIUtil Interface Field Summery

FriedEgg
  • 201
  • 1
  • 3
  • OMI_IGNORE_NOTFOUND will work with UpdateMetadata when you are using that method to perform deletes, such as removing associations of dependent objects – FriedEgg Jul 12 '17 at 00:45
  • Hello @FriedEgg, your comment makes a lot of sense in context of the documentation. Thank you. I will test the code and put an answer here as well as communities.sas.com – Vasilij Nevlev Jul 12 '17 at 05:11