The following is adapted from a Midrange Press Newsgroup Item on changing library lists on the AS/400 - iSeries Web Server:
 

Starting HTTP servers with different library lists

To start a testing HTTP server with a different library list from a live HTTP server:
 
  1. Run WRKSBS on sub-system QHTTPSVR.
  2. Display routing entries on program QCMD in library QSYS, with compare value HTTPWWW.
  3. To add another routing entry to this subsystem, use the ADDRTGE command:

    ADDRTGE SBSD(QHTTPSVR/QHTTPSVR) SEQNBR(1) CMPVAL(*ANY) PGM(YOURLIB/YOURPGM) CLS(QHTTPSVR/QZHBHTTP)

    Now, whenever a job starts in the QHTTPSVR subsystem, program YOURPGM in library YOURLIB gets called. 

  4. Write this program using the following sample CL program that changes the library list for HTTP server job 'TESTING', while leaving the library list the same for any other HTTP server: 

    PGM                                                       
    DCL        VAR(&JOB) TYPE(*CHAR) LEN(10)            RTVJOBA    JOB(&JOB)           
    IF         COND(&JOB *EQ 'TESTING') THEN(DO) 
    CHGLIBL    LIBL(LIB1 LIB2 LIB3 LIB3) 
    MONMSG     MSGID(CPF0000)                                 
    ENDDO                                               TFRCTL     PGM(QCMD)            ENDPGM    

Changing Library List from java Program

Every time you need something from the iSeries in your server process:
  1. Open the connection.
  2. Use command.run("CHGLIBL (PRDDTA PRDPGM QGPL QTEMP)"); inside the java class that needs data.
  3. Find the parameter file that contains the library and change it for whichever process needs a different list. 

Still have questions? We can help. Submit a case to Technical Support.

Last Modified On: December 10, 2016