The CICS Transaction Server for OS/390 CWI Graphics Server


This page gives guidance on the Installation and Execution of the CICS Transaction Server for OS/390 CWI GRAPHIX converter program. This program is a sample program, written in COBOL, to serve graphic images of up to about 47K, through the CWI system, from the PDS pointed to by the appropriate CDO defined DOCTEMPLATE.

When installed, this sample will allow you to deliver graphics through the CWI using the following URL format: http://your.CICS.system:your.port/graphix/pic.gif
where 'pic' is the DOCTEMPLATE defined by CDO in CICS and 'gif' is the name of the MIME file type to be used.

To use the GRAPHIX sample you need to:
1. Create new PDS to store your graphics files
2. Upload JLOGO.JPG and GFNDADDR.GIF to your MVS or OS/390 and follow the instructions below.

These instructions explain how to use the sample GRAPHIX COBOL program. When combined with a few changes to the CWI analyzer program, it will serve a graphic image through the CWI, from a URL such as http://your.CICS.system:your.port/graphix/pic.gif. Any binary data could be delivered to a browser using this program. However, the only supported file types at the moment are GIF and JPEG. An examination of the source code will reveal how easy it would be to handle other MIME file types. GRAPHIX is a CWI converter program. No application logic program is invoked as all processing is done within the DECODE section of the converter.


A number of methods of sending binary data via the CWI exist. One of which is to use the sample code found in the GRAPHIX converter program, which is written in COBOL and it assumes that binary images have been defined as DOCTEMPLATES to CICS.
Here's what to do:

Installation Notes

1. Create a PDS (eg ISHORE.TEMPLATE.GRAPHICS) with variable length records of up to 32K (eg Record format: VB, Record length: 32700, Block size: 32704) to store your graphics files. Add a DD statement to your CICS JCL to point to this PDS (eg //GRAPHICS DD DSN=ISHORE.TEMPLATE.GRAPHICS,DISP=SHR).
2. Copy or move JLOGO.JPG and GFNDADDR.GIF to this PDS, renaming them as JLOGO and GFNDADDR respectively. These files should be transferred to this PDS using FTP, or any other file transfer method with which you are familiar, specifying the BINARY option when transferring them.
3. Translate, compile and link-edit the GRAPHIX COBOL program, using your normal CICS COBOL compile procedures, ensuring it is accessible by CICS through the DFHRPL DD statements in the CICS JCL.
4. Update your CICS System Definition (CSD) dataset with the GRAPHIX program, JLOGO doctemplate and GFNDADDR doctemplate definitions, using the CSD input file provided; CA8C.CSD.
5. Add the following COBOL code to the COBOL analyzer (DFHWBAOX) or write equivalent code in your preferred analyzer language. It should appear after the URL has been scanned for the converter program name but before the URL has been scanned for the alias tranid.

        if wbra-converter-program = 'GRAPHIX '
            move low-values to wbra-dfhcnv-key
            move 'CWBA' to wbra-alias-tranid
            move low-values to wbra-server-program
            move URP-OK to wbra-response
            move 0 to wbra-reason
            EXEC CICS RETURN END-EXEC
        end-if.
What this analyser code does is search for the GRAPHIX program, as a converter, then set up some default values before issuing an early return to CICS.

Reinstall the analyzer and ensure that your modified analyzer is the one being used by the CWI. This can be done by updating the URM in your TCPIPSERVICE (corresponding to your port number) with your new analyzer, closing your CICS TCPIP link (by CEMT SET TCPIP CLO), reinstalling your updated TCPIPSERVICE, and reopening your CICS TCPIP link (by CEMT SET TCPIP OPE).

Back to the top


Execution

If all the above works correctly you should now be able to point your favourite web browser at either: http://your.CICS.system:your.port/graphix/gfndaddr.gif or http://your.CICS.system:your.port/graphix/jlogo.jpeg
and receive back the appropriate graphic. Certain error checking is performed on the URL and appropriate error messages will be returned to the browser if these conditions arise (eg File Not Found, Invalid Filename, ...).

Since MVS doesn't support the concept of filetypes you may find it easier to manage graphical files if you use a naming convention of some type. Maybe, you could continue the naming convention used by this SupportPac, by starting all .gif filenames with the letter 'G' and all .jpg's with the letter 'J'. Alternatively, you could state that all graphics be of type jpg.

Similarly, you must ensure that your binary files do not exceed about 47K in length, as the CICS Web Interface does not support such large template files.

Back to the top