I tried what you suggested. Inside the script there is no return code being returned at least not one I am trapping. I executed the followig code suggested by someone on the LISTSERV:
SYSTEM)"$Import $MessageFlowFile $DeleteOption $LabelOption $UUIDOption") ; $MyScalar = $?; print "\nReturn Code = $MyScalar"; The value printed is zero ('0') BUT....when I try it outside of PERL using your suggestion I get a value: C:\Program Files\IBM\WebSphere MQ Integrator 2.1\Tool>mqsiimportmsgflows.bat c:\myfile.txt -d -l -u file:/C:/Program Files/IBM/WebSphere MQ Integrator 2.1/Tool/Parser: 1, 0: Invalid document structure. BIP1018S: Unexpected exception in utility ImportMsgFlows; method getMsgFlowsFromExportFile. An exception was caught by the ImportMsgFlows utility in method getMsgFlowsFromExportFile. The exception text is: java.lang.Null nt operation will end. Retry the operation if possible. If the exception still occurs, contact your IBM support center. C:\Program Files\IBM\WebSphere MQ Integrator 2.1\Tool>echo %ERRORLEVEL% 18 I do not know the difference between executing the 'SYSTEM' command inside the script as opposed to executing the command from the command line and using the "ERRORLEVEL" variable. I have a work around for the moment. I can trap the output from the command and do a pattern match on the BIP\d+[SE] character string. If I get a hit I know I have an eror. bobbee PSSSSSS I was just looking at a WEB site for the book "perl by EXAMPLE" this was a statement about the $? and $! special variables. So maybe the "return Code" point is mute!! "You can't rely on these variables to check the status of pipes, back-quoted strings, or the system() function when executing scripts under the Windows operating system. My recommendation is to capture the output of the back-quoted string and check it directly for rror messages. Of course, the command writes its errors to STDERR and then can't trap them, and you're out of luck".
From: Pavel Tolkachev <[EMAIL PROTECTED]> Reply-To: MQSeries List <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Date: Fri, 1 Nov 2002 18:02:14 -0500 Hello Bobbee, Try to execute your command line from the command prompt and type in: c:>echo %ERRORLEVEL% right after for both successful and unsuccessful scenarios. This way you will check if you command actually returns the error code you expect. Here is a simple transcript to ensure you it actually must work as you expect: -------cut here----- D:\>dir Volume in drive D is DBWKS Volume Serial Number is CC06-5992 Directory of D:\ 04/23/02 09:25a <DIR> downloads 03/14/02 05:49p <DIR> LJ974 10/15/02 08:54a <DIR> pkg 3 File(s) 0 bytes 8,834,809,856 bytes free D:\>echo %ERRORLEVEL% 0 D:\>dir aa Volume in drive D is DBWKS Volume Serial Number is CC06-5992 Directory of D:\ File Not Found D:\>echo %ERRORLEVEL% 2 D:\>perl -e "system('dir') and die 'error!!!'" LJ974 RECYCLER downloads pkg D:\>perl -e "system('dir aa') and die 'error!!!'" dir: aa: No such file or directory error!!! at -e line 1. D:\> -------cut here----- Hope this will help, Pavel Robert Broderick <robertbroderick@H To: [EMAIL PROTECTED] OTMAIL.COM> cc: Sent by: MQSeries Subject: List <MQSERIES@AKH-Wien .AC.AT> 11/01/2002 03:53 PM Please respond to MQSeries List I am writing a PTP (Promote to Production) function using PERL for NT to execute the IC01 SupportPack Import, Assign and Deploy functions. So far so good. It does what it is supposed to do, in good times. In bad times I am tryig to trap the execution error with the following: system ("$Import $MessageFlowFile $DeleteOption $LabelOption $UUIDOption") and die("\n\nCommand executed with errors\n\n"); I am handing the MQSI import function a bogus XML file. I see the errors comming out BUT...the 'die' isn't catching. Is there another way of trapping the error outputted by the function so I can interrogate it?? OR maybe the function isn't setting the return code at all!!!! bobbee _________________________________________________________________ Unlimited Internet access for only $21.95/month. Try MSN! http://resourcecenter.msn.com/access/plans/2monthsfree.asp Instructions for managing your mailing list subscription are provided in the Listserv General Users Guide available at http://www.lsoft.com Archive: http://vm.akh-wien.ac.at/MQSeries.archive -- This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden. Instructions for managing your mailing list subscription are provided in the Listserv General Users Guide available at http://www.lsoft.com Archive: http://vm.akh-wien.ac.at/MQSeries.archive
_________________________________________________________________ Internet access plans that fit your lifestyle -- join MSN. http://resourcecenter.msn.com/access/plans/default.asp Instructions for managing your mailing list subscription are provided in the Listserv General Users Guide available at http://www.lsoft.com Archive: http://vm.akh-wien.ac.at/MQSeries.archive