Buffered Writter issues

Issues and Questions related to running Apache Tomcat on z/OS
Post Reply
whodges
Posts: 5
Joined: Fri Jan 18, 2008 11:00 am

Buffered Writter issues

Post 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 
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

- DOS filenames (C:\xxx) wont' work on z/OS.

- You can't launch cmd.exe on z/OS
whodges
Posts: 5
Joined: Fri Jan 18, 2008 11:00 am

Post by whodges »

Thank you.
Do you know of anyway that i can have a file be written and launched?
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post 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 ?
whodges
Posts: 5
Joined: Fri Jan 18, 2008 11:00 am

Post 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
whodges
Posts: 5
Joined: Fri Jan 18, 2008 11:00 am

Post 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?
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post by dovetail »

com.dovetail.. is not the right package.

The package is com.ibm.jzos
whodges
Posts: 5
Joined: Fri Jan 18, 2008 11:00 am

Post 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.
dovetail
Site Admin
Posts: 2022
Joined: Thu Jul 29, 2004 12:12 pm

Post 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.
Post Reply