@echo off
set timestamp=%date%%time%
set timestamp=%timestamp:/=%
set timestamp=%timestamp: =0%
set timestamp=%timestamp::=%
set timestamp=%timestamp:.=%

cd /d %BATCH_HOME%

call %BATCH_HOME%\bin\classpath.bat

set SQF=SAMPLE%timestamp%

rem 前処理
%JAVA_HOME%\bin\java batch.BatchStatus -start jid jobname > %SQF%
if not %ERRORLEVEL% == 0 (goto end)

if not exist %SQF% (goto end)
for /f %%a in (%SQF%) do set JSQ=%%a
del %SQF%

rem 実処理
%JAVA_HOME%\bin\java project.batch.sample.SAMPLE %* -o %JSQ%
if not %ERRORLEVEL% == 0 (goto end)


:end

rem 後処理
%JAVA_HOME%\bin\java batch.BatchStatus -end -o %JSQ%

exit %ERRORLEVEL%
