Lab 2 - CGI Programming

Previous Next

We are providing this information to you via the
Internet Connection for AS/400 Server
Home- Company Info- Sales- Support- Press Releases- Mail- Links- OS/400

Introduction to Lab 2 - CGI Programming

OK, so the HTML in your web application has been fixed and it is looking pretty good. But, now look at the comment form you were left with! It simply does not work. Bummer.

We will first fix the ILE RPG program. Then, while that is compiling we will fix the HTML form and take a look at your HTTP configuration.

Where are things located for TEAMnn? (nn=your team number)

Description Value
The URL to your web application http://internut.rchland.ibm.com/ITSOICnn/welcome.htm (or)
file:///c:/ITSOICnn/welcome.htm
Web application is located on the AS/400 /ITSOICnn/*
Web application is located on your PC /ITSOICnn/*
You will be fixing links and graphics in this HTML file /ITSOICnn/imvh501.htm
You will be fixing ILE RPG code in ITSOICnn/QRPGLESRC
member IMVR501
AS/400 userid and password ITSOICnn
ITSOICnn
AS/400 system name host09
PC system name hostnn (for example, team01's system name is host01)
The URL to a working example http://internut.rchland.ibm.com/ITSOIC.400/imvh501.htm

Step-by-Step lab instructions - Part 1 Fix and Recompile IMVR501.PGM

  1. Start a Telnet (tn5250) session to your AS/400. You may want to start two.
  2. Edit IMVR501 in file QRPGLESRC library ITSOICnn
  3. Compile and bind IMVR501

    Make sure the compile does not fail. While it is compiling, you could move onto the next section...

Step-by-Step lab instructions - Part 2 Fix HTML in IMVH501.HTM

  1. Back on the PC, edit IMVH501.HTM in \ITSOICnn.
  2. FTP IMVH501.HTM back to the AS/400.
  3. Test, test and test the Comment Form in your web application.

Questions and Answers Table
Question Answer
Question 1: What is in the QTCP/QTMHCGI service program that your ILE RPG application needs? QtmhRdStin: to read from stdin
QtmhWrStout: to write to stdout
QtmhCvtDb: to parse the input parameters and place them in a DDS defined database file that is very convenient for RPG and COBOL to read from.
QtmhGetEnv: to read an enviroment variable, if needed. Return to Question 1.
Question 2: How will "/BonusCGInn" be mapped to your web application libary ITSOICnn on the AS/400? Use the WRKHTTPCFG command to look at the directives for your team. Here an Exec directive will map /BonusCGInn/* to /QSYS.LIB/ITSOICnn.LIB/* which is the fully qualified path in which you placed the IMVR501.PGM CGI program. Return to Question 2.

Previous Next

Agenda

cgl010