Chapter3: Redirect a VSAM file
to HTML
STEP3.1: Change Handler to read VSAM record as string
Exit Ditto on VSE and stop the Redirector server on Windows using command quit. The handler on Windows should be changed to be able to use string fields only. The handler is stored in <redir>\com\ibm\vse\htmlhandler as HtmlHandler.java Edit the file and make following changes:
1.Change the HTML header tag to create an HTML page that will refresh itself all 5 seconds.
<html><head><title>VSE/ESA Redirector sample</title> <meta
2.Change the lines in the source as below to read a string of 49 char.
-Define all fields as String:
String firstname, lastname, flightnumber, seats, smoker;
-Make the changes below in the source code (it’s in the last
//smoktmp = requestInfo.getString(48, 1);
//if(smoktmp.length > 0)
// | if( smoktmp[0] == 0 ) |
// | smoker = false; |
// | else |
// | smoker = true; |
…..htmloutput.newLine();
htmloutput.flush();
Save the changed file.
To be able to compile it we have to update the CLASSPATH temporary.
set CLASSPATH=VsamRedir.jar;.;%CLASSPATH%
In <redir> type:
javac com\ibm\vse\htmlhandler\HtmlHandler.java 3. Test the changed handler.
Restart the Redirector server on Windows. In <redir> type: run.bat
Use Ditto again, in CHAR mode (right upper corner) add some records with 49 characters each. Now the output.html should refresh itself each 5 seconds and show the inserted records.