Using FileFactory

General discussion on the JZOS batch launcher and toolkit
Post Reply
usaajrm
Posts: 85
Joined: Tue Feb 06, 2007 3:46 pm

Using FileFactory

Post by usaajrm » Sun Sep 27, 2020 11:46 pm

Is there a way to use FileFactory to write to a file from a String as input? I have to write string data to an hfs file and a mvs file.

dovetail
Site Admin
Posts: 1961
Joined: Thu Jul 29, 2004 12:12 pm

Re: Using FileFactory

Post by dovetail » Mon Sep 28, 2020 4:28 pm

How about:

String someString = "abcdefg\nhijklmnop\nqrstuv\nwxyz\n";
BufferedWriter wtr = FileFactory.newBufferedWriter(filenameOrDSN);
wtr.write(someString);
wtr.close();

usaajrm
Posts: 85
Joined: Tue Feb 06, 2007 3:46 pm

Re: Using FileFactory

Post by usaajrm » Thu Oct 01, 2020 3:46 pm

thx you for the example. I need to add a little more information. I'm using BMC's contorlm automation api(s). One of the classes have a method that takes in two File type arguments. the two files contain json data. What i'm trying to do is provide is a File type variable but referencing a z/os file through jzos.

Post Reply