Importing from the command line

This task topic describes how to how to use the common command line importer (mqsicreatemsgdefs) to import C, COBOL copybooks, XML DTD or XML schema in order to populate a message set with message definitions.

Before you start:

Before you attempt the task described in this topic, it is recommended that you read the following reference topic:

The command line importer allows you to create a new message set, into which the message definition files will be placed. When you create a new message set from the command line, only the logical information is created by default. However, the command line importer allows you to create a new message set based on an existing message set. The physical format information from the base message set is also created in the new message set. If you want physical format information to be created as well, you must do the following before you invoke the mqsicreatemsgdefs command:

  1. Using the workbench, create a message set in your workspace that is to be used as a base message set.
  2. To this base message set, add the physical formats that you want to be created in your new message set.

For further details on how to create a message set in the workbench and add physical formats, see Creating a message set.

To import C, COBOL copybooks, XML DTD or XML schema using the command line:

  1. Close the workbench. This must not be running when you use the command line importer.
  2. Invoke the mqsicreatemsgdefs command from a command prompt specifying the message set project name, path name of the source files folder, and any other optional parameters that you require. If you want to add physical formats to the new message set that the mqsicreatemsgdefs command creates, specify the base message set that contains these physical formats as the -base parameter on the import command line. For further information on the command, see mqsicreatemsgdefs command.
  3. When the command has completed, open mqsicreatemsgdefs.report.txt. This report is created when you invoke the mqsicreatemsgdefs command and by default is written to the directory from which you invoked the command. The report provides you with the following information:
    • Details of the parameters that were used when mqsicreatemsgdefs was invoked.
    • The message set level action.
    • The name of the file that has been imported.
    • Details of the import process (for example, any warnings that have been generated and message model objects that have been created).
    • The number of files imported.
    Tip: The step above assumes that you have not used the -log parameter. If you have used the -log parameter, the generated report has the specified file name and is written to the specified location.
  4. Start the workbench and switch to the Broker Application Development perspective. The message definition file created when you invoked mqsicreatemsgdefs is visible in the project that you specified.

If an error occurs during the import of a C, COBOL copybook, XML DTD, or XML schema file, carefully check any errors that the importer reports. By default, all errors are written to the screen and to the file described above. To gather additional information about the import, specify the -v (Verbose) command line parameter. This parameter displays more detailed information as the import proceeds.

Related concepts
Ways to create message definitions
Import from other model representations to create message definitions
Related tasks
Working with a message set project
Related reference
mqsicreatemsgdefs command
Import formats