XML RESOLVE MODEL-NAME

This statement has the following parameters:

Parameter Description
ModelFileName#DataName A nonnumeric literal or an identifier of an alphanumeric data item, the value of which may be any of the following:
  • The name of the data structure. If the # (hash) character is missing, it is assumed that the hash character was intended to be placed at the beginning of the parameter (as the specified name is a data item name). Previously, it was assumed that the # character was placed at the end of the parameter (as the specified name was a filename.

    Everything to the left of the "#" character is the filename. Everything to the right is the data structure name. Either component is optional; that is, model names of "file#", "file", "#data", "#" and "" are allowed. If the filename is omitted and a default has not been provided from the XML COBOL FILE-NAME statement (on page 41), then the current program is assumed. If the data name is not found, then calling programs are used (in order of the call stack).

    If the data name is omitted, then the entire program is used.

    If a hash "#" character is missing from the ModelFileName parameter, one will be assumed to be present at the beginning (the ModelFileName is assumed to be a data name).

    Furthermore, a hierarchical specification of data names may be used; that is, "a//b//c" is valid. It has the same meaning as the COBOL specification of "C of B of A". Either data names or program names may be specified in the data name hierarchy; that is, A and B could be the names of programs, assuming B is a program contained in A.

  • The name of the XML file produced by the XMLGEN compiler directive that describe the COBOL data item. For more information, see Model Files.

The resolved ModelFileName#DataName value is stored in this same data item upon successful completion of the statement.

Description

The XML RESOLVE MODEL-NAME statement is used to resolve the name of a model file/data name combination. The resolution process is the same as that for the ModelFileName#DataName parameter of the XML IMPORT FILE, XML IMPORT TEXT, XML EXPORT FILE, or XML EXPORT TEXT statements.

If the name is a URL, it is used "as is". Otherwise, the name is examined with an .xtl extension and then a .cob extension. If the name component is absent, the current executing COBOL program is searched, followed by calling COBOL programs (if present). Whatever data name (following the "#" character) is present is carried forward.

Example

XML RESOLVE MODEL-NAME 
          MY-MODEL-DATA-FILE. 
IF NOT XML-OK GO TO Z.