HyperTextMarkupLanguage

CGI Lab - Subfile list

Home | Agenda |

CGI Lab - Subfile list

Objective
Provide a response html which would list all the bookshelves available.

Prerequisite
Download library cgidev2 from our site www.easy400.net and install it on your iSeries 400 (AS/400)

Example
See our example.

Resources

  • The bookshelves file is file BCT01A in library CGIDEV2 . This file is a logical file based on physical BCT01 .
    Please look at BCT01 and at BCT01A DDS.

Perform as follow:

  1. Signon on AS/400 as QPGMR
  2. Develop your skeleton html member
    1. strpdm on source file mycgilib/htmlsrc
      and add member lab22a, source type html
    2. Write the following html sections
      • /$top
        to start the html (HTML, HEAD, BODY)
      • /$tabstr
        to start a table
      • /$tabrow
        to define the table row which contains the /%variable_name%/ for a bookshelf
      • /$tabend
        to end this table
      • /$end
        to end the html
  3. Develop your ILE-RPG CGI program
    1. enter command
            cgidev2/crtcgisrc srcmbr(lab22a) srclib(mycgilib) option(3)
      to create the default ILE-RPG module source for this program in mycgilib/qrpglesrc
    2. complete this source:
      you should issue all the previously defined html sections; section tabrow should be issued as a variable line (subfile line) for each input record (bookshelf) from file BCT01A.
    3. compile the module
    4. create the CGI program
    5. to test your CGI program, in the command line of your internet browser enter
      http://.../mycgilib/lab22a.pgm
Further steps (optional)
  1. Add an anchor to each bookshelf.
    This anchor would allow to display all the books on a given bookshelf.
    The anchor should be like
    <A HREF="/centaur2p/cnt02.pgm?action=start&xbct01nbr=/%XBCT01NBR%">/%XBCT01DES%/</A>
    where
    -variable /%XBCT01NBR% should contain the ID of the bookshelf (field BCT01NBR)
    -variable /%XBCT01DES% should contain the description of the bookshelf (field BCT01DES)
  2. Extend the html response of your program
    to include the full initial page of Centaur2.

Lab solutions
Type Run it html rpg
Basic X X X
Complete X X X

Home | Agenda |

LAB22