S
Steve
I'm having some problems with a recursion error in a batch file. The
error message is "BATCH RECURSION exceeds STACK limits" with an
additional line that indicates "Recursion Count=1265" and "Stack Usage=
90 percent." The batch is supposed to process lots of files (sometimes
a few hundred, sometimes a few thousand) in a particular directory on my
server.
The process moves files from one dir to another, runs a osql command on
files with a .log extension and then, 25 at a time, runs start to call
another external batch file that contains another osql command. The
process runs okay for approximately 7 days but dies with the above error
message. I've included the contents of the batch below. Any
suggestions would be welcome.
=========================================
1. @echo off
2. @title=Inventory Load
3. :TOP
4. cd \loading
5. if not exist err mkdir err
6. ECHO %time% Executing Load Inventory
7. osql -S mySQLServer -E -n -o err\%1.err -Q "EXEC
sqlDB1..spLoadInventory"
8. move c:\out\*.* c:\loading > nul
9.for %%a in (*.log) do echo %time% Processing %%a && osql -S
mySQLServer -E -n -i %%a -o err\%%a.err && del %%a
10. SETLOCAL
11. SET /a ctr=0
12. for %%a in (*.out) do (SET fn=%%a) & CALL :LOADEM
13. CALL :LOOP
14. ENDLOCAL
15. :LOADEM
16. SET /a ctr+=1
17. IF %ctr% LSS 25 GOTO OIT
18. ECHO %time% Processing (and waiting for) %fn%
19. START /min /WAIT c:\loadout3.bat %fn%
20. SET /a ctr=0
21. GOTO :EOF
22. OIT
23. ECHO %time% Processing %fn%
24. START /min c:\loadout3.bat %fn%
25. GOTO :EOF
26. :LOOP
27. cls
28. for /l %%a in (1,1,60) do (
29. echo/Waiting 60 Seconds...
30. echo/
31. echo/ ^< %%a ^>
32. ping 127.0.0.1 -n 2 >nul
33. cls
34. )
35. GOTO :TOP
===========================================
error message is "BATCH RECURSION exceeds STACK limits" with an
additional line that indicates "Recursion Count=1265" and "Stack Usage=
90 percent." The batch is supposed to process lots of files (sometimes
a few hundred, sometimes a few thousand) in a particular directory on my
server.
The process moves files from one dir to another, runs a osql command on
files with a .log extension and then, 25 at a time, runs start to call
another external batch file that contains another osql command. The
process runs okay for approximately 7 days but dies with the above error
message. I've included the contents of the batch below. Any
suggestions would be welcome.
=========================================
1. @echo off
2. @title=Inventory Load
3. :TOP
4. cd \loading
5. if not exist err mkdir err
6. ECHO %time% Executing Load Inventory
7. osql -S mySQLServer -E -n -o err\%1.err -Q "EXEC
sqlDB1..spLoadInventory"
8. move c:\out\*.* c:\loading > nul
9.for %%a in (*.log) do echo %time% Processing %%a && osql -S
mySQLServer -E -n -i %%a -o err\%%a.err && del %%a
10. SETLOCAL
11. SET /a ctr=0
12. for %%a in (*.out) do (SET fn=%%a) & CALL :LOADEM
13. CALL :LOOP
14. ENDLOCAL
15. :LOADEM
16. SET /a ctr+=1
17. IF %ctr% LSS 25 GOTO OIT
18. ECHO %time% Processing (and waiting for) %fn%
19. START /min /WAIT c:\loadout3.bat %fn%
20. SET /a ctr=0
21. GOTO :EOF
22. OIT
23. ECHO %time% Processing %fn%
24. START /min c:\loadout3.bat %fn%
25. GOTO :EOF
26. :LOOP
27. cls
28. for /l %%a in (1,1,60) do (
29. echo/Waiting 60 Seconds...
30. echo/
31. echo/ ^< %%a ^>
32. ping 127.0.0.1 -n 2 >nul
33. cls
34. )
35. GOTO :TOP
===========================================