Quantcast
Channel: Visual COBOL - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4356

file hander between command line and jvm cobol

$
0
0

A question about file hander between command line and jvm cobol.

environments description

os:windows7

dev IDE: Micro Focus Enterprise Developer 2.2 Update 2 for Eclipse

projects:there are 2 projects

        1,pure java project (1 source only)

        2,jvm cobol project(1 source only) 

now,execute the program by the below order

    command line → jar(pure java project) → jar(jvm mfcobol project)

but below error was happed.

-----------------------------------------------the below-is--full test source---------------------------------------------------------------------

ttt.bat file:

--start-------------------------------

set JDK_PATH = "C:\Program Files\Java\jre7\bin"
set CLSPATH = %CLSPATH%;"C:\bat\xxx\mfcobol.jar;C:\bat\xxx\mfcobolrts.jar;C:\bat\xxx\mfsqljvm.jar;
set CLSPATH = %CLSPATH%;"C:\bat\xxx\test1.jar;C:\bat\xxx\test2.jar;C:\bat\xxx\cblrtsm.dll"
%JDK_PATH%\java -Xms128m -Xmx512m -cp %CLSPATH% -Djava.library.path=C:\bat\xxx TESTJVMCOBFILE
pause

-----end----------------------------

pure java source

----start----------------------------

public class TESTJVMCOBFILE {

public TESTJVMCOBFILE() {
// TODO Auto-generated constructor stub
}

/**

* @param args

*/

public static void main(String[] args) {

// TODO Auto-generated method stub
String file1 = "C:\\bat\\temp\\dat\\dat1.txt";
TESTFILE tf = new TESTFILE();
tf.instanceMethod(file1);
System.out.println("OK");

}

}

----end-------------------------

jvm mf cobol project

---start--------------------

class-id TESTFILE public.

ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
OBJECT-COMPUTER.
PROGRAM COLLATING SEQUENCE IS EBCDIC-CODE.
SPECIAL-NAMES.
ALPHABET EBCDIC-CODE IS EBCDIC.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT OUT1-F ASSIGN to dynamic OW1-SYSOUT
ORGANIZATION IS LINE SEQUENTIAL
file status is ws-file-status.

FILE SECTION.
FD OUT1-F.
01 OUT1-REC.
02 OUT1-CARDNO PIC N(11) USAGE NATIONAL.


working-storage section.
01 OW1-SYSOUT PIC X(255).
01 ws-file-status PIC XX.


method-id instanceMethod.
LINKAGE SECTION.
01 OW1 PIC X(255).

procedure division USING BY VALUE OW1.

MOVE OW1 TO OW1-SYSOUT.
INITIALIZE OUT1-REC.
OPEN OUTPUT OUT1-F.

MOVE "123456" TO OUT1-REC.
WRITE OUT1-REC.
CLOSE OUT1-F.

goback.
end method.

end class.

---end--------------------

if directly execute the above source without ttt.bat in the eclipse dev IDE,it is works.

but use command line source(ttt.bat),like that above image was displayed.

It's important that my project must dymanic setting full filepath to cobol in the pure java source.

who can help me?

I'm waitting for your replySleep

 


Viewing all articles
Browse latest Browse all 4356