Someone else pointed me towards using SYSTEM. That is what you need if you want to be able to capture the return code. However, I am still having issues. I am able to call the DOS batch script, but it always seems to give me a return code of 0. So, I wrote the following simple iDM procedure and DOS batch files...
The iDM procedure is...
-SET &RETCODE = SYSTEM(25,'e:\SCRIPTS\test.bat AFTER','D4');
-TYPE #### Return Code: &RETCODE
The batch file being called (which is on the DM server) is...
ECHO Starting batch file
if (%1)==(BEFORE) EXIT /B 1
if (%1)==(AFTER) EXIT /B 2
ECHO No parameters
EXIT /B 0
Since the batch file is being passed AFTER as a parameter, I am expecting (hoping) to see a return code of 2. I keep seeing a return code of 0. I have tried it with and without the /B parameter on the exit statement in the DOS batch file. The batch file seems to be taking the correct path. The output shows that it is exiting because the parameter was AFTER. Here is the console log...
02/12/2014 14:14:21 DANL-DEV C:\ibi\srv77\dm\edatemp\ts000011>ECHO Starting batch file
02/12/2014 14:14:21 DANL-DEV Starting batch file
02/12/2014 14:14:21 DANL-DEV C:\ibi\srv77\dm\edatemp\ts000011>if (AFTER) == (BEFORE) EXIT /B 1
02/12/2014 14:14:21 DANL-DEV C:\ibi\srv77\dm\edatemp\ts000011>if (AFTER) == (AFTER) EXIT /B 2
02/12/2014 14:14:21 DANL-DEV #### Return Code: 0
Anyone have any ideas on why I am not seeing the number that is being set in the EXIT?
iDM 7.7.05
WebFOCUS 7.7.05
Windows, All Outputs