3.14 Saving a WAM's Output to a File

In addition to running a WAM from a web browser, you can also run a WAM from  the X_RUN command line to save the output to a stream file.

The syntax for the X_RUN command line for a Windows platform is:

the ending '\' for each line is added as a line continuation indicator to make the command line easier to read in this documentation. The above is meant to be a single command line to be submitted inside a command prompt.

Note: For IBM i and Linux, the actual command line required is slightly different but the X_RUN arguments required are much the same.

The following X_RUN arguments are essential to run a WAM and save the output to a stream file:




"*WAMSP" is the special fixed value to activate this function.


WAM name to be executed.


WebRoutine name in the WAM to be executed.


Markup language to run the WAM in the WMOD argument. Optional. The default is LANSA:XHTML.


Partition where the WAM in the WMOD argument, belongs.


Language for running the WAM in the WMOD argument,.


User for running the WAM in the WMOD argument. Optional for some platforms.


Output file path where the WAM output will be saved. The path required follows the syntax of the platform where the WAM is executed.

For example, for Windows, you would enter: C:\Temp\wam_output.html (with backward slash characters). For IBM i, it is the IFS format and with Linux, uses forward slash characters.


Additional X_RUN arguments can be added. For example, ITRO, ITRM and ITRL can be used to enable tracing. Refer to the X_RUN Parameter Summary in the Visual LANSA Technical Reference for more information.

For example:

Where, for Windows:

the above command line executes WebRoutine myrtn of WAM mywam in partition DEM using the markup language LANSA:XHTML and saves the output html into  the stream file C:\Temp\myrtn.html.

For Linux, the equivalent command line would be:

Note that the x_run command is in lower case and the output file path is in the Linux format.

For IBM i, the equivalent command line would be:

There are a few limitations when running a WAM in this manner: