IBM WAVV 2004 manual Redirect a Vsam file To Html, Change Handler to read Vsam record as string

Page 13

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 http-equiv=refresh content=5></head>

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 3-rd ) firstname = requestInfo.getString(0, 20); lastname = requestInfo.getString(20, 20); flightnumber = requestInfo.getString(40, 4); seats = requestInfo.getString(44, 4); smoker = reqeustInfo.getString(48, 1);

//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.

Image 13
Contents VSE Connectors Workshop VSE Connectors Workshop VSE/ESA 2.6/2.7 Vsam Redirector TCP/IP Redirect Vsam requests to a Html On Windows OverviewNavigate to VSE Redirector Server home Steps for installation of Vsam Redirector server on WindowsVerification if Java environment installed Steps for installation on a WorkstationInstall JDK if not on the system Download latest Code via Html Download VSE Redirector server CodeJava install Install VSE Redirector ServerVerify Redirector server Documentation Verify installation Vsam Redirector ServerStart VSE Redirector server For Windows Start Programs Vsam Redirector Online HelpRedirector Server Handler Redirect a Vsam requests to a HtmlConfiguration for Redirector Client on VSE\ESA VSE Settings to redirect a Vsam clusterAccess the Vsam file with Ditto Change Handler to read Vsam record as string Redirect a Vsam file To HtmlSummary Goal Redirect Vsam requests To a DB2 database on WindowsField name Type Offset Length Redirect a Vsam file to DB2CLASSPATH% Ksds FFSTORES.REPRO.CLUSTER FFSTORES.REPRO.CLUSTERFinished FFSTORES.DEMO.CLUSTERAdditional Information