Page 1 of 1

file read error -Java JAR via BPXBATCH

PostPosted: Fri Jan 12, 2024 5:20 pm
by dbals
Hello Folks,
I'm a long time reader of the posts in these forums.

I recently ventured into running a Java JAR file via Z/OS Unix. I'm running into a wall with my limited knowledge around this.

I have a shell script that I run via BPXBATCH and that has the java -jar command with options. One of the JVM options I pass is -Dfile.encoding=ISO-8859-1 to indicate the input file (unix file) is in ASCII.
When I run JAR pointing to a file that I had exported from PC to Z/OS Unix, the JAR reads the file fine.
But, when I add steps in JCL that copy a mainframe file to unix file and then use iconv to convert from IBM1047 to ISO-8859-1, Java is seeing junk values.

I do see via oedit panel that the file used is indeed ascii - even hex on proves that.

what could possibly be wrong? is there anything that could be automatically converting the file? I even displayed the file just before the JAVA -JAR command in the shell script. I see the hex values to be ascii. So the file is definitely Ascii.
Something is automatically converting the file in one case and one case it is not.

Pls share your ideas.

Re: file read error -Java JAR via BPXBATCH

PostPosted: Mon Jan 15, 2024 9:19 am
by dbals
I figured out the problem. When we import a text file from pc to unix, it behaves like a VB file as there is no concept of record in windows. Java program expects a windows like file to read.
When i EDIT the file in mainframe and copy (a FB file to Unix), after the content of the record, it fills up with spaces (x'40 in ebcdic to x'20' in ascii). Java program has issues with this. I changed the mainframe file from FB to VB and then copied into unix. This made the file look like a PC file with no extra padding of spaces beyond record.
:)