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.
file read error -Java JAR via BPXBATCH
-
- Posts: 2
- Joined: Fri Jan 12, 2024 10:57 am
- Skillset: Cobol, Assembler, REXX, CICS, JCL
- Referer: Google
Re: file read error -Java JAR via BPXBATCH
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.

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.

Re: file read error -Java JAR via BPXBATCH
How did you upload the file to the z/OS USS?
If you're using ftp you might want to try "binary" mode or "quote site SBD=(IBM-273,ISO8859-1)".
If you're using ftp you might want to try "binary" mode or "quote site SBD=(IBM-273,ISO8859-1)".
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Error invoking java method (array) IGZ0045S
by JgbCobol » Mon Nov 07, 2022 3:54 pm » in Mainframe Java - 2
- 5539
-
by JgbCobol
View the latest post
Tue Nov 08, 2022 12:32 pm
-
-
- 8
- 4939
-
by enrico-sorichetti
View the latest post
Fri Mar 12, 2021 4:09 pm
-
- 2
- 1425
-
by naga821
View the latest post
Fri Oct 28, 2022 7:31 pm
-
-
Can i read output file created after SORTing in the same pgm
by savitha_y » Sat Feb 06, 2021 1:17 am » in IBM Cobol - 4
- 1599
-
by savitha_y
View the latest post
Tue Feb 09, 2021 7:11 pm
-
-
-
EZIOE004 Logical I/O error on file occurred reading VB file
by savitha_y » Mon Feb 15, 2021 7:54 pm » in CA-Easytrieve - 3
- 4946
-
by savitha_y
View the latest post
Wed Feb 17, 2021 5:02 am
-