Using FileFactory

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

Using FileFactory

Post by usaajrm »

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: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Re: Using FileFactory

Post by dovetail »

How about:

String someString = "abcdefg\nhijklmnop\nqrstuv\nwxyz\n";
BufferedWriter wtr = FileFactory.newBufferedWriter(filenameOrDSN);
wtr.write(someString);
wtr.close();
usaajrm
Posts: 87
Joined: Tue Feb 06, 2007 3:46 pm

Re: Using FileFactory

Post by usaajrm »

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