Search

Showing posts with label CICS. Show all posts
Showing posts with label CICS. Show all posts

Friday, September 25, 2015

Trigger CICS transaction Batch programs

There are many situations where user has to trigger CICS transaction via batch jobs. This becomes handy when any CICS program is being coded and situation occurs to allocate/de-allocate files.

However, there is one installation required up hand for CICS to accept the commands from batch; the console definition must be defined in the terminal table. Sample console definitions are provided by IBM supplied resource group DFH$CNSL. You would require your CICS administrator to set up if not done. 

Use the MODIFY command to trigger the transaction from a batch job. MODIFY command is abbreviated to F.
Example:  Following JCL launches the transaction TXN1 in the CICS region CICRGN1
//CICSBTCH JOB …
//STEP001 EXEC ...
// ………..
//STEP002 EXEC PGM=IEFBR14
// COMMAND 'F CICRGN11,TRA1'
//*
Note
i) The MVS command is directly executed without waiting for the completion of the STEP001.
ii) The above command triggers the transaction TRA1 in the region CICRGN11.
iii) The command must be placed between quotes.

To avoid the execution of the command before the completion of STEP001, launch the MVS command in separate job.
Example:
//BTCHSUB JOB ......
//STEP001 EXEC ......
// --------
//STEP002  EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT1     DD DATA,DLM=@@
//CICSBTCH JOB ……
//STEPR  EXEC PGM=IEFBR14
// COMMAND 'F CICRGN11,TRA1'
//SYSUT2 DD SYSOUT=(A,INTRDR)
//SYSIN DD DUMMY
//*
In the above job, STEP002 submits the batch interface job (CICSBTCH) to internal reader upon the completion of the step STEP001. Thus the transaction TRA1 is triggered only after the completion of STEP001.

Trigger JCL via SPOOL option in CICS

CODE SNIPPET

 
IDENTIFICATION DIVISION.  
PROGRAM-ID. SAMPLE.  
AUTHOR.
DATE-WRITTEN. 04/01/XXXX.
DATE-COMPILED. 04/01/XXXX.
*******************************************************************
* CODE SNIPPET TO FORM JCL VIA CICS.                              *
* ONLINE PROGRAM CALLED THROUGH TRANSACTION                       *

*******************************************************************


ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
DATA DIVISION.
WORKING-STORAGE SECTION.

01 WS-T PIC X (8).
01 JCL-CARDS.
05 FILLER PIC X (80) VALUE '//SAMPLE JOB (XYZ),"BATCH RUN"','.00
05 FILLER PIC X(80) VALUE '// CLASS=E,MSGLEVEL=(1,1),REGION=0M,MSGCLASS=X'.
05 FILLER PIC X(80) VALUE '//THREAD EXEC PGM=IKJEFT01,DYNAMNBR=20'.
05 FILLER PIC X(80) VALUE '//STEPLIB DD DSN=CEE.SCEERUN,DISP=SHR'.
05 FILLER PIC X(80) VALUE '// DD DSN=CEE.SCEECICS,DISP=SHR'.
05 FILLER PIC X(80) VALUE '// DD DSN=CEE.SCEELKED,DISP=SHR'.
05 FILLER PIC X(80) VALUE '// DD DSN=SYS1.DSNXXX.SDSNLOAD,DISP=SHR'.
05 FILLER PIC X(80) VALUE '// DD DSN=DSNXXX.DBXX.RUNLIB.LOAD,DISP=SHR'.


05 FILLER PIC X(80) VALUE '// DD DSN=ABCD.XXX.COBLOAD,DISP=SHR'.
05 FILLER PIC X(80) VALUE '// DD DSN=ABCD.XXX.ASMLOAD,DISP=SHR'.
05 FILLER PIC X(80) VALUE '//SYSTSPRT DD SYSOUT=*'.
05 FILLER PIC X(80) VALUE '//SYSPRINT DD SYSOUT=*'.
05 FILLER PIC X(80) VALUE '//SYSABOUT DD SYSOUT=*'.
05 FILLER PIC X(80) VALUE '//SYSDBOUT DD SYSOUT=*'.
05 FILLER PIC X(80) VALUE '//SYSUDUMP DD SYSOUT=*'.
05 FILLER PIC X(80) VALUE '//SYSOUT DD SYSOUT=*'.
05 FILLER PIC X(80) VALUE '//SYSIN DD *'.  
05 WS-THREAD-DTLS.
  10 FILLER PIC X(12) VALUE 'CTRANSAC 0001'.  
  10 FILLER PIC X(68) VALUE ' '.
05 FILLER PIC X(80) VALUE ' '.
05 FILLER PIC X(80) VALUE '/*'.
05 FILLER PIC X(80) VALUE '//SYSTSIN DD *'.
05 FILLER PIC X(80) VALUE ' DSN SYSTEM(DBXX)'.
05 FILLER PIC X(80) VALUE ' RUN PROGRAM(PXXXXXX)-'.
05 FILLER PIC X(80) VALUE ' PLAN(PXXXX)'.
05 FILLER PIC X(80) VALUE 'END'.
05 FILLER PIC X(80) VALUE '//*'.
05 FILLER PIC X(80) VALUE '/*EOF'.

01 FILLER REDEFINES JCL-CARDS.
  05 CARD OCCURS 27 TIMES INDEXED BY CARD-INDEX PIC X(80).
 
01 WS-JCL-LINES PIC 9(3) VALUE 27.

PROCEDURE DIVISION.

A-MAIN-PARA.

PERFORM B-MAIN-PROCESS THRU B-MAIN-PROCESS-EXIT
 
PERFORM C-TERMINATION THRU C-TERMINATION-EXIT

A-MAIN-PARA-EXIT.
EXIT.
 
B-MAIN-PROCESS.

EXEC CICS
SPOOLOPEN OUTPUT
USERID('INTRDR')
NODE('XXXX')
TOKEN(WS-T) 
NOHANDLE
END-EXEC

Sunday, September 13, 2015

What is MRO - Multi Region Operation! Why is it useful! How is TOR, AOR and FOR linked?

               Using Intercommunication Features in CICS

MRO - Multi Region Operation is used connect CICS region running on the same processor. 
Each System has its own address space independently, hence if any region goes down others are not affected.

Typical MRO includes

  • TOR - Terminal Owning Region which owns all the Terminal
  • AOR - An Application Owning Region that owns all the Applications
  • FOR - File Owning Region that owns all the Files

How transaction routes from TOR to AOR?

The PCT entry in the Terminal Owning Region is defined as below:

Terminal Owing Region (PRVT)

Transaction: ABC1
Type:       Remote
Sysid:          PRVA

Application Owing Region(PRVA)

Transaction: ABC1
Type:           Local
Program: XYZ123P

- Any transaction is triggered in the TOR terminal. It checks PCT entry for type and sysid for AOR
- Transactions then routes to the AOR where its defined local in PCT and hits program defined in it.
- Any I/O transaction to be done is routed back to TOR 

How transaction is shipped from AOR to FOR?

In Application Owing Region(PRVA)

XYZ123P
Reads Customer1

File Control Table Definition in AOR
Type: Remote
File : Customer1
SYSID: PRVF
Reclen: 258
Key: 25

In File Owing Region(PRVF)

File Control Table Definition in FOR
Type: Local
File : Customer1
Access: VSAM KSDS


  • Function shipping allows to access resource defined in the other region.
  • If Program defined in AOR, needs to access file which is defined local in other region, FCT entry is defined with sysid of the FOR region and file type is defined as remote
  • Once the program needs to read this file, the control is transferred to the FOR region where file is residing as local. 
  • Program accesses required information and passes control back to AOR region.





Separate CICS Business Application Transactions and CICS Default Communication Transactions

Separate Default and Application Level Transaction

This is kind of good practice to always separate Default CICS Transaction from the application level of Transaction.

Once the TCPIP connections are established between Web Services and CICS; 
 - All the CICS services runs under CIEP transaction as its defined and linked to the TCP IP service and port/host of the Web Services

- All the services running under default is copied to the mirror transaction as its defined as communication parameter for Web Services

- Also when messages are serviced from the Web Services, generally CICS receives program which needs to be invoked and that application level program runs under default transaction 

- In these cases, if any application level service is invoked it runs under default transaction CIEP which creates problem if any user needs to debug

The Flow is 

What is ECI?

External Call Interface 

ECI calls are the way of communication between CICS and Web Services which uses TCP IP connections.

Client Side or Web Service need not use BMI setups to connect to CICS online transactions.

ECI calls are set up and linked the CICS default transaction. And on the client side or Web Service side can be set up in a way where it can run on mirror transactions

Read Blog for more reference  : TCPIP CONNECTION BETWEEN CICS AND WEB SERVICES

Establishing TCP IP service between Web Services and CICS via CIEP Default transactions

                    TCPIP Connection between CICS and Web Services

If you have any Java front end connected to CICS via Web Services following parameters needs to be taken care of:

Currently, I have tested with the Web Services using WSDL objects. There are Web services use the standard web protocols HTTP, XML, SOAP, WSDL, and UDDI. WSDL (Web Services Description Language) is an XML-based language used to define web services and to describe how to access them. 

- Connection between CICS and Web Method Serivces via TCP IP protocols
- Define TCP IP Service and link it to the port number

Command in CICS

Tuesday, February 12, 2013

Options of CICS DB2 connections

Options of CICS DB2 connections 

There are three main types of threads that can  be used for DB2 CICS connection:

TYPE=COMD
TYPE=POOL
TYPE=ENTRY

COMD is DB2 command thread it is used for only processing DB2 commands through DSNC transaction.  It is not used for CICS attachment facility.

POOL is Pool threads are used for all transactions and commands not using an entry type or a DB2 command type. Pool threads are normally used for: 

  1. Low volume transactions
  2. Overflow transactions  from both COMD and ENTRY type threads 
  3. It is terminated immediately when it is unused

ENTRY is ENtry type thread which is used for: 

  1. High volume transactions 
  2. High priority transactions 
  3. Controlled transactions 

ENTRY type can be defined as protected as well as unprotected.The MVS subtask for an entry thread is not terminated, even if the entry thread is terminated. This is true for both protected and unprotected entry threads. 
Requests for an entry thread can be transferred to the pool, if an entry thread is not available.

Sunday, January 20, 2013

CEDC Command to check MQconnection


CEDC Commands that can be used to check MQ connection 

If any user wants to know INITQ or any MQ manager or any other MQ parameter here is the command:

CEDC V MQ

It will give option as below. If you dont know give * for both the options and then press enter:

OBJECT CHARACTERISTICS
   CEDC View MQconn(         )
     MQconn         ==>      
*

     Group            ==>       *

It will display all the MQConn for all the sysplex region as below.

ENTER COMMANDS
NAME            TYPE            GROUP                       LAST CHANGE 
MQ1A            MQCONN      CICSAB1             25/04/11   11:11:11
MQ1A             MQCONN     CICSAB2   v        25/04/11   11:11:11   
      
Give View in front of group you want to view as I gave above in red and press enter.

Sunday, January 13, 2013

Common CECI CICS commands used while debugging


CECI Commands that can be used to test or debug any CICS program

There are many commands in CICS which can be very handy when any developer wants to do unit testing.

CECI READ FIL(XYZ) RID(&A)

 Give F5 and define &A give length for that temporary character

When you give above command it will not read file until it is open. It will give errors as below: 

Saturday, January 12, 2013

Triggering CICS transaction through batch - PART3


Common Error Messages - Batch Processing

Please refer PART1 and PART2 blog before going through this blog.

There are some common error messages that may be thrown when the transaction is launched using from the batch job.

1) When the CICS region is not active
IEE341I                       CICSREN1 NOT ACTIVE

2) When the console is not defined in the CICS Region
DFHAC2015 date time CICSREN1 Console consname has not been defined to CICS.

3) When the transaction does not exist in the CICS region
DFHAC2001 date time CICSREN1 Transaction 'tranid' is not recognized.

4) When the transaction is disabled in the CICS region
DFHAC2008 date time CICSREN1 Transaction tranid has been disabled and cannot be used.

Triggering CICS transaction from batch - PART 2


Options commonly used in CICS to trigger transaction through Batch

Please refer Part 1 before going to this blog.

1: For some application user id and password is mandatory.This can be done by Identifying Transactions with Userid & Password

If the transaction requires sign-on, CESN transaction can be send as first command
Example:
// COMMAND 'F CICREN1,CESN USERID=xxx,PS=yyyy'
// COMMAND 'F CICREN1,TXN1'

Triggering CICS transaction from batch - PART1


Basics on Triggering transaction from batch

In CICS, we can trigger transaction from batch. Before triggering there is some settings which should be present for CICS to accept the commands from batch, there is console definition which should defined in the terminal table and these are provided in the IBM supplied resource group DFH$CNSL. Please check if that is set else contact admin group of CICS to have that set up.

MODIFY command is used to trigger the transaction from a batch job and it abbreviated to F.
Example: 
Following JCL executes the transaction TXN1 in the CICS region CICREN1
//CICSBTH1 JOB …
//STEP001 EXEC ...

Sunday, October 21, 2012

OTE (Open Transaction Environment)

What is OTE (Open Transaction Environment)?

Task Control Block 

The open transaction environment (OTE) function was added to CICS Transaction Server for OS/390, Version 1 Release 3 and later versions.

In earlier releases of CICS, CICS ran all user transactions under a single z/OS TCB, the CICS quasi-reentrant (QR) TCB. Direct invocation of other services outside the scope of the CICS permitted interfaces could interfere with the use by CICS of the QR TCB. In particular, requests that resulted in the suspension ("blocking") of the QR TCB, which happens when an MVS wait is issued, would cause all CICS tasks to wait. For example, some services provided by DB2, MVS, UNIX® System Services, or TCP/IP, might result in TCB blocking.