Page 1 of 1

Java Output in MVS File or SYSOUT

PostPosted: Wed Aug 31, 2011 3:29 pm
by olivermf
Hello,

I have a problem with my output in MVS Datasets from Java.

As described at IBM http://www.ibm.com/developerworks/syste ... atchz.html I did the following:
ZFile outZFile = new ZFile("//DD:"+filename, "wt");
OutputStream ostream = outZFile.getOutputStream();
OutputStreamWriter wtr = new OutputStreamWriter(ostream, ZFile.DEFAULT_EBCDIC_CODE_PAGE);
BufferedWriter logfile = new BufferedWriter(wtr);
logfile.write("Text1");
logfile.newLine();
logfile.write("Text2");
logfile.newLine();


If I look at the output there are always two lines between the "Text"-lines.
Text1

Text2


If I output the text without the newLine()-Command the output is:
Text1Text2


What can I do? I do not find anything about it in documentations about Java and z/OS. The "\n" from Java I have already tried...

Regards

Oliver

Re: Java Output in MVS File or SYSOUT

PostPosted: Tue Sep 13, 2011 6:45 pm
by olivermf
Hello,

I found the solution myself now.
My problem only occured, because I printed out to long output lines with a length 1 byte longer than my lrecl of my output file.
So the system made automated crlf and I did not notice at first.

Regards

Oliver

Re: Java Output in MVS File or SYSOUT

PostPosted: Wed Sep 14, 2011 2:09 am
by dick scherrer
Good to hear you have found a solution - thank you flr letting us know :)

This will likely help another with a similar question one day,

d