[stackoverflow] [progress Openedge Abl] Batch File Runs And Writes To Log, But Won't...

Status
Not open for further replies.
E

EmacsVI

Guest
I have written a java program that needs to be executed within a batch file. When I run the program that executes the batch file, the batch file will create and write to the appropriate logs, but will not run the executable jar.

My batch file:

SETLOCAL ENABLEEXTENSIONS
SET me=%~n0
SET parent=%~dp0
SET log=C:\apps\HL7\src\Error_log\Pipeline_batch_log.txt

ECHO /* ************************* Error Log Initiated ************************* */ >> %log%
ECHO %DATE:~10,4%:%DATE:~4,2%:%DATE:~7,2%-%TIME:~0,2%:%TIME:~3,2%:%TIME:~6,2% >> %log%
ECHO %parent% >> %log%
ECHO %me% >> %log%

CD c:\apps\HL7\src

IF %ERRORLEVEL% NEQ 0 (
ECHO error - CD failed. >> %log%
)

ECHO java -jar HL7toSS.jar "%1" "%2" "%3" "%4" "%3" "%4" >> %log%

java -jar HL7toSS.jar "%1" "%2" "%3" "%4" "%3" "%4">> %log%

DEL c:\apps\HL7\src\%2

IF %ERRORLEVEL% NEQ 0 (
ECHO error - HL7 xml file did not delete. >> %log%
)

ECHO /* ****************************** END OF LOG ****************************** */ >> %log%

EXIT


As you can see, I log the output from the executable jar, but it is silent (I'm assuming because it doesn't ever run). I also log the command that should be running; copying this command and running it in Command Prompt works just fine.

Here is the output I'm seeing in my log file

/* ************************* Error Log Initiated ************************* */
2017:05:31-14:38:16
C:\APPS\HL7\src\
Pipeline_batch
Infile: Inbound_EDI_Files\test_1.txt HL7file: HL7_XML_Files\793723096202_HL7_test_1.xml MPAXMLfile: C:\apps\HL7\src\Processed_SS_Files\successful\793723096202_SS_test_1.xml MPAXMLERRfile: Processed_SS_Files\failed\793723096202_ERR_test_1.xml BIOMEDXMLfile: C:\apps\HL7\src\Processed_SS_Files\successful\793723096202_SS_test_1.xml BIOMEDXMLERRfile: Processed_SS_Files\failed\793723096202_ERR_test_1.xml
java -jar HL7toSS.jar "Inbound_EDI_Files\test_1.txt" "HL7_XML_Files\793723096202_HL7_test_1.xml" "C:\apps\HL7\src\Processed_SS_Files\successful\793723096202_SS_test_1.xml" "Processed_SS_Files\failed\793723096202_ERR_test_1.xml" "C:\apps\HL7\src\Processed_SS_Files\successful\793723096202_SS_test_1.xml" "Processed_SS_Files\failed\793723096202_ERR_test_1.xml"
/* ****************************** END OF LOG ****************************** */


Copying and pasting the same command in the Command Prompt yields the following expected results

c:\APPS\HL7\src>java -jar HL7toSS.jar "Inbound_EDI_Files\test_1.txt" "HL7_XML_Fi
les\793722688601_HL7_test_1.xml" "C:\apps\HL7\src\Processed_SS_Files\successful\
793722688601_SS_test_1.xml" "Processed_SS_Files\failed\793722688601_ERR_test_1.x
ml" "C:\apps\HL7\src\Processed_SS_Files\successful\793722688601_SS_test_1.xml" "
Processed_SS_Files\failed\793722688601_ERR_test_1.xml"
Processing: main
Processing: Convert to XML
Finished: Convert to XML
Processing: Choose
Finished: Choose
Skipping: MPA XSLT operator: Input is not available.
Skipping: MPA Validate operator: Input is not available.
Processing: BIOMED XSLT operator
Finished: BIOMED XSLT operator
Processing: BIOMED Validate operator
Finished: BIOMED Validate operator
Finished: main

c:\APPS\HL7\src>


Do you see anything that would be causing the batch file to fail silently when attempting to run the jar?

EDIT:

Running the batch file itself from the command prompt also works. The issue seems to stem from the calling program, which is a Progress ABL procedure. The ABL procedure is executing the batch file as follows:

ASSIGN runthis = "C:\apps\HL7\src\Pipeline_batch.bat " + INpath + " " + HL7path + " " + SSpath + " " + XML-ERRpath.

OS-COMMAND SILENT VALUE(runthis).


We know the parameters being passed into the batch file are correct because of the log.

Continue reading...
 
Status
Not open for further replies.
Top