ISPFHTML: Generate HTML or Word processor documents from an ISPF screen

If you need to put ISPF screen captures in a web page but don't want to make your readers wait for downloads of imbedded graphics, you can use ISPFHTML to generate an HTML file containing the screen image. The screen text is put in a formatted table with a caption.

ISPFHTML can also save screen images in Rich Text Format (RTF) which is readable by most major word processors.  You can use this to capture screen layouts, colored program source from the editor, or any other ISPF screens.

Please note.  This is the first time I've ever looked at RTF, so if you have problems with the RTF function, please let me know .

User's of Tom Brennan's excellent  VISTA TN3270 terminal emulator can use this Vista Macro to capture all data in an edit session, download the RTF file and open the results with their word processor.  Put it in your vista directory as USER1.MAC, enter an edit session and press the '1' button in the emulator tool bar to run the macro.  you must have KEYLIST OFF in effect.

ISPFHTML can also capture screens to an ISPF panel source format, so that you can show parts of screens in tutorials panels. Screens, or portions of screens are created in panel logic as dynamic areas and use shadow variables to get character level highlighting. (If you didn't understand this paragraph, just skip it. This function is something that probably no one but me will ever use.)

This is a work in progress. Last update January 17, 2000, but I think the basic function is complete

ISPFHTML is available as a TSO XMIT format load module.

To get the program using Netscape or Internet Explorer, select the link above with the right mouse button and select 'Save Link As...' or Save Target as...'. 

See the installation instructions below for more information.

Function

Generate an HTML table or Rich Text Format (RTF) document containing a copy of  a displayed ISPF screen.

Also can be used to generate an ISPF panel containing an image of the screen. This image can then be copied into other panels for use in tutorials and help screens. (See the help screen for LMAC for an example of how this can be used).

Known restrictions:

This program gets information from ISPF internals. However, ISPF processes panels in many steps and the information that ISPFHTML uses is information before the final screen image is generated. Some information, such as popup information is not available and errors can occur because of that. There are a few known restrictions:

  1. This may be very release dependent and may break at any time.
  2. In split screen, only the displayed part of the active screen is captured.
  3. Reverse video is shown as bold characters in HTML (due to an HTML limitation).
  4. RTF format does not specially highlight reverse video or blinking characters.  Underscores are written to RTF files.
  5. There may be combinations of underscore , blink and/or reverse video that are not handled correctly. I don't know of any at the moment.
  6. Underlying windows are always saved in blue. Since ISPFHTML can't tell if there are popups in previous SELECT levels, you may see some captures use too much blue.
  7. Screen captures in GUI mode may produce strange results.

Calling Syntax from ISPF:

ISPFHTML must be called with ISPEXEC SELECT PGM().
Parameters are passed using the PARM() keyword of the SELECT statement.

Parameters:

All parameters are optional.

ROW,startrow,endrow Line number to start and end the screen capture. Either startrow or endrow can be omitted. Startrow defaults to 1. endrow defaults to the last visible line.
COL,startcol,endcol Column number to start and end the screen capture. Either startcol or endcol can be omitted. Startcol defaults to 1. Endcol defaults to the screen width.
NOSTART Do not include the <table>,<caption> ,<tr>, and <td> and other table opening tags. Use this when you are capturing a second and subsequent screens while capturing a scrollable screen such as an edit session. (HTML only)
NOEND Do not include the </table>, and other table closing tags. Use this when you will be capturing additional screens while capturing a scrollable screen such as an edit session. (HTML only)
APPEND Append a new table to the same output data set (HTML only)
HTML Save the screen capture in HTML format. HTML is the default. Panel and RTF output will not be saved.
PANEL Save the screen capture in ISPF panel source format. HTML and RTF will not be saved.
RTF Save the screen capture in Rich Text Format (RTF).  You can then download the output into a word processor.   HTML and RTF will not be saved.
DOWNLOAD Download the file to C:\ispfcap.htm  or C:\ispfcap.rtf and start your web browser or word processor to see the file. DOWNLOAD only works for HTML and RTF, and requires a connection with the ISPF workstation agent. Windows 9x and NT 4.0 only. This is done with the commands:
ISPEXEC FILEXFER HOST(H) WS(W) TO(WS) TEXT

ISPEXEC SELECT WSCMD(%comspec% /C START /min &W)

Examples:

ISPEXEC SELECT PGM(ISPFHTML) PARM(LINE,2,19,COL,9,DOWNLOAD)

Capture the data portion of an edit session (assuming no action bars) from lines 2 through 19 and columns 9 and higher. Then, if a workstation agent connection exists, download the file and view it in a web browser).

ISPEXEC SELECT PGM(ISPFHTML) PARM(PANEL,COL,50,77)

Capture columns 50 through 77 and save the image in ISPF panel format.

A sample CLIST is shown below. I included some extra logic to browse the created file or, if a workstation agent connection exists, download it via the ISPF workstation agent and show it in your browser (this runs on my Windows 95 and Windows NT 4.0 systems). Change this as you need to.

PROC 0
SET CAPTION = This is an ISPF screen capture
ISPEXEC VPUT (CAPTION) SHARED
ISPEXEC LIBDEF ISPLLIB DATASET  ID('NADEL.ISPFHTML.LOAD')
ISPEXEC SELECT PGM(ISPFHTML) PARM(DOWNLOAD)
ISPEXEC LIBDEF ISPLLIB
ISPEXEC VGET ZWSCON
IF &ZWSCON = &STR() THEN /* If no workstation connection exists */ -
  ISPEXEC BROWSE DATASET(ISPFCAP.HTM)  /* browse output */
Sample screen capture CLIST

I strongly suggest doing screen captures with a PF-key set to the command that calls ISPFHTML.

You can set a variable called CAPTION in the SHARED pool before the ISPEXEC SELECT PGM(ISPFHTML) if you want to add a caption to your screen capture. If a caption is not supplied or is blank, the panel name is used as a caption.

Output

    HTML:

A sequential data set containing one or more HTML tables, each table containing one screen capture. If you don't preallocate ddname ISPFHTML then the data set name is 'userid.ISPFCAP.HTM' (or if you're TSO prefix is different than your userid, 'prefix.userid.ISPFCAP.HTM'). If ddname ISPFHTML is not preallocated, then 'userid.ISPFCAP.HTM' is deleted if it exists and is recreated each time the program is run.

    RTF:

A sequential data set containing one or more screen captures in RTF format. If you don't preallocate ddname ISPFHTML then the data set name is 'userid.ISPFCAP.RTF' (or if you're TSO prefix is different than your userid, 'prefix.userid.ISPFCAP.RTF'). If ddname ISPFHTML is not preallocated, then 'userid.ISPFCAP.RTF' is deleted if it exists and is recreated each time the program is run. Some options, such as APPEND haven't been tested yet with RTF format.

    PANEL:

For ISPF panel source format, the output data set name is ISPFCAP.PANEL

You may also preallocate any sequential file to ddname ISPFHTML. If the allocation is DISP=MOD then the screen capture will be added to the end of the data set. Use this feature when you want to capture several screens into one HTML file.

Installation

  1. Copy ispfhtml.xmi to your PC in BINARY format
  2. Upload the file in BINARY to a FIXED 80 SEQUENTIAL file named ISPFHTML.XMI
  3. On TSO, type RECEIVE INDA(ISPFHTML.XMI) and at the prompt respond DA(ISPFHTML.LOAD)
  4. Copy and modify the CLIST sample shown above and assign that CLIST name to a PF key.

Samples

This screen was originally captured using ISPFHTML. Users of Netscape version 4 or higher should see some blinking items.  An RTF format version of this file is also available.

 
Panel VISTA
 +---------------------------- Screen capture test ----------------------------+
 |   Menu  Help                                                                |
 | --------------------------------------------------------------------------  |
 |                                Screen Capture Test                          |
 | Command ===>                                                                |
 |  Char level (Norm,uscore,reverse,blink):  RGBTWYPRGBTWYPRGBTWYPRGBTWYP     |
 |  Colored Graphic escape characters:       +-+++++++                         |
 |  Mixed character level attributes:        UScore                            |
 |                                                                             |
 |    Underscore output   Uscore Input     Blink text       +-------+          |
 |    WHITE                                WHITE            | +-+-+ |          |
 |    RED                                  RED              | | | | |          |
 |    PINK                                 PINK             | +-+-+ |          |
 |    GREEN                                GREEN            | | | | |          |
 |    YELLOW                               YELLOW           | +-+-+ |          |
 |    TURQ                                 TURQ             +-------+          |
 |    BLUE                                 BLUE                                |
 |                                                                             |
 |    Type (output): ISPF 4.8MVS     TSO                                       |
 |    Hidden Input field: (Contains data but should not display)               |
 |      ===>          (that is a hidden field)                                 |
 |                                                                             |
 |                                                                             |
 +------------------------------------------+ ---------------------------------+
 | This is a long message shown in a        | 
 | message pop-up on the screen.            | 
 | It should show up surrounded by a frame. | 
 +------------------------------------------+ 

Use your browser's "View Source" method to see the actual HTML for these screens.