Advanced Debugging System for CICS
      logo

      The First Name in CICS Debugging    

      CICS Tips & Tricks

      The following contributions are from various sources. All disclaimers apply. You are encouraged to post a contribution to this page and you will receive a free gift for sharing your experience.
      Terminating a CICS transaction.

        Most of the times, while executing a CICS transaction, we encounter situations where in the transaction holds the resources and goes in a loop. To terminate this event, type the following command:

        CEMT I TA(*)
        All the transactions running are listed, then go the transaction that is looping and give an FP command against it. This forcefully purges the transaction and frees the buffer space.

        Pradeep B K
        Assistant Systems Engineer
        TATA Consultancy Services
        Table No - 076, Upper Ground Floor, Discoverer
        International Tech Park, Whitefield Road
        Bangalore - 560 066, India.


      Transforming Existing CICS Applications into Enterprise Services

        First of a three-part series that shows how to transform existing CICS External Presentation Interface (EPI) applications into enterprise services using the 3270 terminal service development tools that are part of the Enterprise Services Toolkit in WebSphere Studio Application Developer Integration Edition (Application Developer).

        Step-by-step exercise to demonstrate how enterprise services can be quickly created from the CICS EPI IVP Menu application.

        You can download most of these resources from IBM developerWorks Toolbox.

        Jeff Condon
        IBM


      Unwanted Paging Command

        In a Bms map, if the first field with attribute FSET has the value of "x/" (where x is a one-bye alphabetic character), and you have specified in your SIT that PGRET=x/ or PGPURGE=x/, when you press a function key the character string will be used as a paging command and you'll receive a DFH41XX messagge on the scren. You can avoid this by defining a ghost field with ASKIP,FSET atributes as the first field on the map.

        Andrea Baldini
        CSPO Centro per lo studio e la prevenzione oncologica
        Firenze - Italia


      Last Temporary Storage Record

        When using a VSAM KSDS file in CICS and one need's to position the key to the last record in the file, move HIGH-VALUES to the key field (RIDFLD) and then execute a STARTBTR. This will position to the last record and a subsequent READNEXT or READPREV can be executed. The record contents should be the last record on the file.

        Albert Vallejo
        Softnosis Inc.
        13310 Toka Court
        Huntersville, NC 28078


      Peformance in CICS 4.1 or greater

        Utilize the CETR transaction to to see if you have any unnecessary traces running. Remove any trace you don't need. In application programming, start using the DFHRESP function to test the EIB return codes instead of using HANDLE conditions.

        James Williams


      Migrating from CICS 3.3.0 - AUTOCONNECT

        In CICS 3.3 we specified AUTOCONNECT as NO for sessions and connections participating in LU 6.2 communications. This allowed CICS to automatically create sessions (ie. winners and losers). After migrating to 4.1, we had to change the parameter to YES to make sure that CICS continued to automatically create the sessions with LU 6.2 devices. Otherwise the client had to establish the sessions themselves.

        Anonymous (from the UK)


      CICS jobname

        If you are in an exit and need to know the CICS jobname, the following code will do it:

              L    R5,16          CVT ADDRESS
              L    R5,0(,R5)      NEXT TCB
              L    R5,4(,R5)      OLD TCB
              L    R5,180(,R5)    JSCB
              L    R5,260(,R5)    JCT
              LA   R5,24(,R5)     POINT TO THE JOBNAME 
        
        David Mishoe
        CSX Technology
        Senior Technical Specialist

      ESDS vs Temp Storage

        If your CICS system interfaces with VSAM files, it is better to use an ESDS file rather than Temporary Storage Queues as VSAM ESDS provides the same functionality as that of a TSQ.
        This is because CICS does not have a locking facility for Temporary Storage, while VSAM locks the entire CI. It is advisable to have a control interval as small as possible and always do a READ WITH UPDATE option which will lock the CI and release the lock using the UNLOCK COMMAND.

        Flavian Dsouza
        Kanbay I Pvt Ltd.
        MIDC
        Talawade
        Pune, India


      VSAM updates from BROWSE

        If you are using STARTBR and you want to update a particular VSAM record, then follow these steps:

        • End the browse on the desired record by issuing a READ UPDATE.
        • REWRITE after changing the the contents.
        • Issue another STARTBR.
        • Issue READNEXT twice (the 1st one will reread the same record).

        Arun Arora
        Citicorp Overseas Software Ltd.


      CICS Commands in Batch (EXCI)

        Earlier this year I developed some programs (batch and CICS) which would use EXCI to request CICS functions from a batch program. The programs perform the following:

        • Change status of a file.   Open, Close, Enable, Disable, Unenable and change the Browse, Read, Add, Delete, Update status.
        • Change status of transaction.   Enable and Disable.
        • Change status of program.   Enable, Disable, and Newcopy.

        You can download the 12K zipped file which contains the source for the four COBOL programs, the batch commands, and the JCL procedure.

        Sam Butters
        Maricopa County - ATC, Arizona USA
        CICS - Technical Services
        602-506-7782


      CICS Internet Gateway presentations

        Michael Erichsen from CSC Denmark has several presentations at his website.

        Michael Erichsen
        CSC


      Macro Assembler support in CICS/ESA and Transaction Server

        Contrary to the documentation, most Assembler macros will function correctly if you do the following:

        • The program must issue all macros using AMODE-31.
        • The CSA address must be in Register 13.
        • The TCA must be loaded into R12.

        The offsets of the required CSA and TCA are different, so you must recompile with the current DSECTs. The actual calling sequence, bit settings and EQUATEs remain unchanged since CICS Version 2, so you can copy the macros from a prior CICS release if necessary.

        As of CICS 4.1.0, the interface to DFHFC was removed and the only DFHPC macros that still work are:

          DFHPC TYPE=ABEND
          DFHPC CTYPE=LINK,PCLASS=SYSTEM
          
        Some shops implemented this illegal technique as a temporary method of migration.

      How to find:
        The CSA in all MVS releases and CICS/VSE Transaction Server.
           L     13,16              CVT
           L     13,0(,13)          TCB
           L     13,4(,13)          CURRENT TCB
           L     13,X'D0'(,13)      TCB EXTENTION
           L     13,X'14'(,13)      AFCS
           L     13,8(,13)          COMMON SYSTEMS AREA
           L     12,CSACDTA         X'4C'(13) IS THE TCA
        
        The current program PPT entry (prior to CICS 4.1.0, it was easily obtained from TCAPCTA):
           L     Rn,TCALCDSA        X'10'(12) from TCA
           L     Rn,X'50'(,Rn)      TASENTRY from KERNTASN
           L     Rn,X'A0'(,Rn)      XMT from TAS_XM_TRANSACTION_TOKEN
           L     Rn,X'9C'(,Rn)      PTA (CICS/TS 1.3 offset is X'AC')
           L     Rn,X'18'(,Rn)      PLCB from PTA_PLCB_HEAD
           L     Rn,X'1C'(,Rn)      PPT from PLCB_PROG_PPTE
        

      Security Migration

        After migrating from CICS 3.3 to CICS 4.1 you have to change the USEDFLTUSER attribute for the connections from NO to YES to make sure you use the right security for the connections. Otherwise the CICS system user authority will be used.

        P. J. Jansen
        S.E.
        Interpay
        P.O. box 30500
        3503 AH Utrecht , Netherlands


      MVS macro considerations

        For CICS 3.3.0 and greater, use of certain MVS Macros may cause a problem. For example, when using the MVS 'Time' Macro, LINKAGE=SYSTEM (don't use SVC in CICS), the program issuing the macro will require the PPT-Parameter 'EXECKEY(CICSKEY)' instead of 'USERKEY' (Default) together with SIT Storage Protect=YES.
        Also, if the program issuing the restricted macro is called 'Statically', the calling program's EXECKEY must be 'CICSKEY'. IBM does list other Macro's in their 3.3.0 and greater documentation.
        Note that this problem does NOT exist in 2.1.x or 3.2.1. Sites that have decided to utilize this Macro for Y2K compliance and have NOT tested their design in a 3.3.0 and greater environment, may want to re-visit their design structure and adjust accordingly. This could be a very devastating disruption for a company when migrating to 3.3.0 and greater if this situation is not considered.

        William O'Boyle
        WOB Consulting, Inc.
        5385 Arbor View Way
        Sugar Hill, GA 30518-6962
        (770) 614-6069


      START REQID and TS QUEUE conflict

        We spent most of the week on a curious bug: It turns out that the REQID of a START must not be the same as the name of any TS QUEUE in the system.
        The documentation isn't all that clear, but this is apparently what they mean by "duplicate name".

        Jonathan Rosenne
        JR Consulting
        P O Box 33641, Tel Aviv, Israel
        Phone: +972 50 246 522 Fax: +972 9 56 73 53


      Controlling long query transactions

        To give a user the ability to get the status of (or abort) a lengthy inquiry, you can design the query as a separate task and provide communication between it and the terminal user. One method, is to have the terminal task write a record to transient data identifying the termid and the query to be started. It can then issue an "EXEC CICS DELAY" with an interval equal to the maximum time you want to make the user wait and a REQID including the TERMID. The transient data queue should have a trigger level of one to begin processing the query request. When complete, it writes the results back in a temporary storage record which includes the TERMID as part of the QUEUE and cancels the wait of the original task. The original task, after issuing its wait, reads the temporary storage record. If not found, it tells the user that the query is in progress and asks if they want to wait. If they answer no, you end the terminal task. You could then give them another transaction to check the query at a later point by trying to read the temporary storage record. If they answer yes, you re-read the temporary storage record to see if the query completed. If not, you go back into the wait. I hope this helps give you some ideas on how to handle queries that may take longer than the user expected. Any questions, let me know.

        Bruce Giordano


      Non-CICS macros

        Many MVS (and I suppose VSE) macro services can be performed directly without having an impact on total system performance if you use this technique. Issue the "execute" form of the macro and use the following command to wait for it's completion:

        EXEC CICS WAIT EXTERNAL ECBLIST(ecb_ptr) NUMEVENTS(1)
        We use this to process our PDS files using BPAM which isn't "supported" in CICS.

        John Raps
        My employer takes no responsibility for my opinions, and neither do I.


      Advanced Debugging System for CICS
      [HOME PAGE] [EXAMPLES]
      [TECHNICAL] [MARKETING]

      Next page for more Tips. . . next page
      Gary Bergman Associates, Inc.
      14 Hickory Lane • North Brunswick, NJ 08902
      Telephone: 732 247-2727  •  Fax: 732 846-3515
      E-mail: