Java Output in MVS File or SYSOUT



Support for Java SE, EE & ME, JVM, JNI, JDBC, EJB, JFC, JPDA, JAAS,JCE, JAXP, XML and Java API.

Java Output in MVS File or SYSOUT

Postby olivermf » Wed Aug 31, 2011 3:29 pm

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
olivermf
 
Posts: 53
Joined: Tue Feb 08, 2011 4:28 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Java Output in MVS File or SYSOUT

Postby olivermf » Tue Sep 13, 2011 6:45 pm

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
olivermf
 
Posts: 53
Joined: Tue Feb 08, 2011 4:28 pm
Has thanked: 3 times
Been thanked: 0 time

Re: Java Output in MVS File or SYSOUT

Postby dick scherrer » Wed Sep 14, 2011 2:09 am

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
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to Mainframe Java

 


  • Related topics
    Replies
    Views
    Last post