The information in this article applies to:
Product: MIM and PM4Data
Version: 8.x
Platforms: Open Systems
Discussion
The XMOSYSPM exit provides an interface for executing operating system commands or programs as part of an exit or script program. This script is an enhanced replacement for the XMOSYS System Call exit. XMOSYSPM provides the same method and takes the same arguments as XMOSYS, so it is a drop-in replacement.
The primary difference is that the XMOSYSPM exit captures the output of the system command. In the sample provided, the output of the system command is captured as a status reference object and will appear in the status auditor.
The XMOSYSPM can be modified by the user to parse the output of the executed command. The benefit of the XMOSYSPM exit is that the output can be programmatically parsed very easily since STDOUT and STDERROR are captured in an XMOBJECT.
The default behavior of the exit is to display the output in the Process Auditor.
When running Windows commands, it is recommended to prefix the Windows command with CMD /C, which will execute the command specified in the string and then terminate. In addition, if a fully qualified path name is NOT specified, standard operating system path name resolution will apply.
The XMOSYSPM exit can be invoked the same way that the XMOSYS exit is called. The only difference in argument syntax is that the -exitdll argument will say XMOSYSPM instead of XMOSYS.
For example, the following FTF command line request invokes a Sender Pre Exit (5) to execute the dir command (this should be executed as 1 line):
C:\\>ftf -sqm MYQMGR -dqm MYQMGR -spath c:\\spath\\test.file -dpath c:\\temp\\test.file -exit 5 -exitdll xmosyspm -exitentry xmoSysCall -exitqm MYQMGR -exitdata "cmd /C dir c:\\temp" -wait 10
Sample output in the Process Auditor:
Output \[XML\] (2007-10-03 11:24:43) Label: Output Info: ProcessInfo Type: XML ReferenceTime: 2007-10-03 11:24:43 ProcessId: ActivityId: 87fc5c4f-ef0d-4758-9f64-9a8ca4445eaf ReferenceId: dd1a60de-719f-4ece-8d61-c3dd3dd1a738 cmd /C dir c:\\temp Volume in drive C has no label. Volume Serial Number is AC41-08F7 Directory of c:\\temp 09/28/2007 09:45 AM . 09/28/2007 09:45 AM .. 10/03/2007 10:25 AM 19 test.file 09/24/2007 02:44 PM 19 test.file.2007092418441700 09/25/2007 01:29 PM 19 test.file.2007092517293500 02/21/2007 11:03 AM 19 test.file2 4 File(s) 1,423,828,461 bytes 12 Dir(s) 23,966,130,176 bytes free UNKNOWN 0
If you get an error such as XMOPM is not a registered COM component while trying to run the XMOSYSPM exit, this means that the XMCOM.xml entry in the registry needs to be updated. To do this, edit and update XMCOM.xml, which is found in the registry under the key Local/XMCOM.xml.
Add the following entry into XMCOM.xml:
xmopm
- Save and commit XMCOM.xml into the registry.
- Restart the Exit Processor.