Page 1 of 1

Buffered Writter issues

Posted: Fri Jan 18, 2008 11:20 am
by whodges
I am trying to print out a file as my code executes. I am running tomcat 5.5.23 on my desktop and on the mainframe it is 5.0.28.

When i run the application from my desktop it works. From teh mainframe the program works but does not create any output. Do you know if the older version is too dated to know the commands.

Code: Select all

try {
		
             // Write to temporary file
	               BufferedWriter out = new FileFactory.BufferedWriter(new FileWriter("C:\\UploaderErrors.txt"));
	    
	    
			 out.write(  "Row" + (j+1) + " " + getError_Msg() + " - Value " + strCell_Contents );
			 out.newLine();
			                      }
                                  
             
           }
          
         if (j == getTheLastRow())
         {
          Runtime.getRuntime().exec("cmd.exe /C \"C:\\UploaderErrors.txt\"");
          }
      }//end for each row 

Posted: Fri Jan 18, 2008 7:57 pm
by dovetail
- DOS filenames (C:\xxx) wont' work on z/OS.

- You can't launch cmd.exe on z/OS

Posted: Tue Jan 22, 2008 11:55 am
by whodges
Thank you.
Do you know of anyway that i can have a file be written and launched?

Posted: Tue Jan 22, 2008 1:18 pm
by dovetail
It looks like your Windows code is writing a file and launching a Windows app to view it (Notepad?).

I don't know what you would want to do on a server without a user interface.... maybe you should just write the errors to System.err ?

Posted: Wed Jan 23, 2008 1:06 pm
by whodges
Thank you once again.
Let me give you a better idea of what i am doing.

I am validating data that i am getting from an excel spread sheet. If the data is incorrect/not valid i need to create a new spreadsheet/txt that lets the user know what was wrong. On this spread sheet i will have the column, the generated message, and the value.

In a visual basic program that i am re-writing the following is displayed in excel

Accounting Department must be 2 characters - row - 8 value 583


So i want to do something similar to this. Write each line as an error that happens, and after all the errors are located open the newly created spreadsheet.

Do you have an idea of what i want to do and if it is possible

Posted: Thu Jan 24, 2008 9:52 am
by whodges
When i try to import com.dovetail.jzos.FileFactory;
The symbol comes back unresolved. I believe i need filefactory to perform the results i want on the mainframe. Is that a safe assumption, and if so why can i not see the package, and what needs to be done?

Posted: Thu Jan 24, 2008 9:54 am
by dovetail
com.dovetail.. is not the right package.

The package is com.ibm.jzos

Posted: Thu Jan 24, 2008 10:21 am
by whodges
Thanks.

The package is still not found. I assume i have to place this package in a folder where it will be accessed from. Where do i get the information needed to setup the files how i need them.

Once i get it set up on my computer i will still have to talk to the mainframe group to get it there as well.

Posted: Thu Jan 24, 2008 10:49 am
by dovetail
the package com.ibm.jzos is in ibmjzos.jar, which should be in your classpath. If you are running with the SDK version of JZOS, this jar is automatically in your boot class path.