Use the DOS command <EXIT_VDM to close a DOS session independent from the number of called nested command processors (<EXIT only closes the last called command processor).
Source: The OS/2 WARP Survival Guide