Step 3 Run WAM to output a file on IBM i

LANSA WAM

Step 3. Run WAM to output a file on IBM i

1.  Check in and compile WAM iiiEmpEnqToFile. Its  layout will be included in the check in list of objects, automatically. Also check in the common layout iiilay01, if it has not been checked in before. Review the Check In tab to ensure the Check In was successful

2.  Start an emulator session. Log on with your Visual LANSA user id and password. Call the command processor with

     CALL QCMD

     Display a full screen by pressing F11.

3.  Enter the following command:

LANSA REQUEST(X_RUN) PARM01('PROC=*WAMSP') PARM02('WMOD=IIIEMP_4') PARM03('WRTN=DETAILS') PARM04('WAML=LANSA.XHTML') PARM05('PART=TRN') PARM06('LANG=ENG') PARM07('WASP=/TMP/IIIEMPDET.HTML') PARM08('UDEF=A0090')     

     Note: You can copy this command string from WAM Tutorials in the online guide and use the Edit/Paste menu option in Client Access emulator to copy the command into the 5250 screen. Then press F4 to prompt the LANSA command.    

     Correct the call command for your WAM Identifier name, partition name and user name. Check that your IBM i has a /tmp folder in the IFS or use a suitable alternative folder.

     Press Enter to run the WAM.

4.  Use WRKLNK to view the /tmp folder and find your output HTML file.

     Note: Your call command should have run successfully because your library list was correct, so that the X_RUN program was found. You logged on a LANSA developer and therefore had the correct library list.

     If you were creating a CL program to run this job, you would need to establish the correct library list. For example:

ADDLIBLE <PGMLIB>
LANSA REQUEST(X_RUN) PARM01('PROC=*WAMSP') PARM02('WMOD=IIIEMP_4') PARM03('WRTN=DETAILS') PARM04('WAML=LANSA.XHTML') PARM05('PART=TRN') PARM06('LANG=ENG') PARM07('WASP=/TMP/IIIEMPDET.HTML') PARM08('UDEF=A0090')

 

     where: <PGMLIB> is your LANSA program library.

     You could also consider error handling in the modified details WebRoutine. What to do if the UDEF variable is non-blank but the FETCH employee record is unsuccessful?

     Once again, if you have access to the /tmp folder from Windows explorer the iiiempdet.html can be opened in the browser, but it will be unformatted.

5.  Copy the output HTML file to the appropriate IBM i web server /images folder. For example:

CPY OBJ('/tmp/iiiempdet.html') TODIR('/lansa_<PGMLIB>/webserver/www/htdoc

s/images') REPLACE(*YES)

     where <PGMLIB> is your LANSA program library.

     Check that the TODIR parameter is correct for you installation of LANSA.

6.  Put the following URL into your browser address bar:

http://10.44.10.238/images/iiiempdet.html
 

     where: 10.44.10.238 is your IBM i IP Address (or use its server name). Your saved web page should now be displayed correctly formatted and the required style sheets (CSS) will have been included.