Tag Archives: cics tips

Accessing “The Good Stuff” With CICS Explorer in CICS/TS 4.1

When I initially installed CICS/TS 4.1 in our Systems test environment, I started looking for what was new and improved in this version over the 3.2 we had been running. One thing I was looking forward to was seeing the “update” options available in CICS Explorer; in version 3 of CICS/TS, there were many options teasingly grayed out. However, when I loaded CICS Explorer and pointed it at my shiny new CICS/TS 4.1 region, those options were still grayed out!

After doing some web searches, I found information that indicated that to access the update functions, I would need to change the CICS Explorer connection type from CICSPlex SM Data Interface to CICS Management Interface. Of course, nothing is ever that easy …

When I changed the CICS Explorer to use  the CICS Management Interface, I got the following error when I tried to connect:

org.xml.sax.SAXParseException: The element type “HR” must be terminated by the matching end-tag “</HR>”

Boy, it is really clear what this means, isn’t it? Translated into English, this is what it is really saying:

“You tried to access a port with the wrong protocol; make sure you are using a CICSPlex SM Data Interface to access a WUI port, or a CICS Management Interface to access a CMCI port.”

Up to this point, I had never heard of a CMCI port. However, it was fairly trivial to define new WUI parm, CMCIPORT, and point CICS Explorer to that port when using the CICS Management Interface. Once that was done, I magically got all the update options.

IBM has a procedure documented for setting up CMCI in stand-alone (non-CICSPlex) CICS regions so that they, too, can be accessed with CICS Explorer. (Thanks go to Chris Hodgins over at The Master Terminal for that link!)

Follow theCICSguy on twitter here

Sending Email from CICS

If you are not sending email from CICS in your shop, you really need to add that capability. If you do not currently have a need for it, “build it and they will come” … The reasons for sending email from within CICS will start popping up like nobody’s business once it is in place.

Assuming you have SMTP set up on z/OS, sending email from CICS is a snap. If you do not have SMTP set up, I would recommend reviewing the info available on Lionel B Dyck’s site and Dave Alcock’s Planet MVS site. Once SMTP is set up, all you have to do is write records to the punch queue in the correct format, and SMTP will take care of the rest.

To get kick-started, I recommend reviewing three different products. They are all easy to use, and they are all FREE!

First, if you are not already running Lional B Dyck’s XMITIP, then go to his site now and download it. It is a facility to send email from batch, so you can integrate that into your batch processes and you can consider generating JCL from CICS that uses it to send email.

Next, take a look at IBM SupportPac CA1H. It shows how you can create the records in the correct format and send them to the punch queue so that SMTP will pick them up and send them out as an email message.

And if that’s too much work, grab a copy of XMITCICS. It is very easy to install, and with it you can just assign values to working storage and link to XMITCICS from your application to send email messages. It also has a convenient batch facility called XMITMAIL.

If you haven’t already done so, check these out and bring 21st century functionality to your CICS applications!

Finding the z/OS Sysname in CICS

Today I’ve got a simple but neat little tip to share. Have you ever had a need to know which z/OS system your CICS program is running in? I found myself in that situation today, needing a way to programmatically set the hostname in the URL in a CICS web application. The CICS web application could be running in any LPAR. The z/OS system running in each of our LPAR’s has a unique sysname, so if I could access that, I could determine the hostname for that z/OS.

Looking in SYS1.MACLIB(CVT), we see that z/OS has a control block called the CVT (Communications Vector Table) that contains the sysname 340 bytes into it. In the comments at the top of that member, we learn that there is a pointer to the CVT in the PSA (Prefixed Save Area) x’10’ bytes into it. The PSA is easy to find – it is at address 0. So, armed with this info, I wrote the sample code below, which you are welcome to use or incorporate into your own project. If you use this code, just define a PPT for it (if you do not use autoinstall for programs) and point a tranid to the program.

IDENTIFICATION  DIVISION.
PROGRAM-ID.     CVTTEST.

ENVIRONMENT  DIVISION.
DATA  DIVISION.
WORKING-STORAGE  SECTION.

01   WS-PSA-POINTER.
10   PSA-PTR-PIC9        PIC S9(8) COMP-5 VALUE  0.
10   PSA-PTR             REDEFINES PSA-PTR-PIC9 POINTER.

01   SEND-AREA.
10   FILLER              PIC X(1)  VALUE SPACE.
10   FILLER              PIC  X(11) VALUE 'CVTSNAME = '.
10   SA-CVTSNAME         PIC X(8)  VALUE  SPACES.

LINKAGE  SECTION.

01   PSA.
10   FILLER              PIC  X(16).
10   CVT-PTR             POINTER.

01   CVT.
10   FILLER              PIC  X(340).
10   CVTSNAME            PIC  X(8).

EJECT

PROCEDURE  DIVISION.

100-MAINLINE.

SET ADDRESS OF PSA TO  PSA-PTR.
SET ADDRESS OF CVT TO  CVT-PTR.

MOVE CVTSNAME TO  SA-CVTSNAME.

EXEC CICS SEND  FROM(SEND-AREA)
LENGTH(LENGTH OF  SEND-AREA)
END-EXEC.

999-RETURN.

EXEC CICS  RETURN
END-EXEC.

GOBACK.