Your exit %error_status% in LOAD_TABLE_WRAPPER.BAT ends your batch session, so your MASTER_LOAD.BAT will never be able to resume from the next call.
You can fix the problem by simply adding the / B option to the EXIT command
exit /b %error_stats%
I almost never use EXIT without / B in a batch file (although there are times when / B is not needed).
But another alternative is to run called scripts via CMD instead of CALL.
::MASTER_LOAD.BAT CMD /C LOAD_TABLE_WRAPPER.BAT Table1 Dev CMD /C LOAD_TABLE_WRAPPER.BAT Table2 Dev CMD /C LOAD_TABLE_WRAPPER.BAT Table3 Dev
There are a number of differences between the methods.
CALL with EXIT / B
- Relatively fast
- Can save values ββof environment variables upon return (SETLOCAL is available if you do not want to save values)
- A script is called that inherits pending extensions and extension states (enabled or disabled)
CMD / C
- Relatively slow
- Cannot save environment variable values ββafter return. (You can write the definitions to a file and load them back after returning to the wizard, but this is not convenient or efficient).
- The script invoked always starts with delays with the extension and extension by default (normal slow extension is disabled and extensions are enabled)
I would never recommend using CMD / C over CALL if the called batch files do not have EXIT without the / B option, and you cannot change the batch file to add the / B option.
source share