| ObjectiveProvide a response html which would list all the bookshelves
available.
 PrerequisiteDownload library cgidev2
from our site
www.easy400.net
and install it on your iSeries 400 (AS/400)
 ExampleSee 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:
 
Further steps (optional)Signon on AS/400 as QPGMR
Develop your skeleton html member
    
    strpdm
        on source file
        mycgilib/htmlsrcand add member
        lab22a,
        source type
        html
Write the following html sections
        
        /$topto start the html (HTML, HEAD, BODY)
/$tabstrto start a table
/$tabrowto define the table row
            which contains the
            
            /%variable_name%/
            for a bookshelf
/$tabendto end this table
/$endto end the html
Develop your ILE-RPG CGI program
    
    enter commandcgidev2/crtcgisrc srcmbr(lab22a) srclib(mycgilib) option(3)
 to create the default ILE-RPG module source for this program
        in
        
        mycgilib/qrpglesrc
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.
compile the module
    create the CGI program
    to test your CGI program,
        in the command line of your internet browser
        enterhttp://.../mycgilib/lab22a.pgm
 
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)
Extend the html response of your programto include the full initial page of Centaur2.
 Lab solutions
 
| Type | Run it | html | rpg | | Basic | X | X | X |  | Complete | X | X | X |  |