What is the difference between a Run Unit, SEQNO and TSN?

Document ID : KB000044569
Last Modified Date : 14/02/2018
Show Technical Document Details

Question: 

To cancel a task you use the Sequence number (SEQNO)  with REQABORT or the TSN number with the TSN_ABORT  command.  What is the difference between SEQNO and TSN? And how  do they differ from a run unit?

 

Answer: 

Run Unit

A run unit number is assigned to each job that connects to a MUF. This occurs when the job issues an OPEN command to open a URT.

 

Transaction Sequence Number (TSN)

A TSN is assigned to a job when an update command is issued. The TSN represents a logical unit of work. 

After a LOGCP, LOGCR, COMIT, CLOSE or CICS SYNCPOINT the unit of work is committed and subsequent update commands from the same job will be assigned a new TSN.

So a batch job will have one run unit number for the duration of the job but could have many TSNs.

Similarly with CICS it has one run unit number but each transaction from different terminals will have separate TSNs. 

The TSN number can be used in a TSN_ABORT command to terminate a transaction.

 

Internal Request Sequence Number (SEQNO or SEQ)

The SEQNO is a sequential number assigned to each command. This is a MUF wide counter, the first command issued will be 1 then each subsequent command no matter from what job it comes from will be assigned the next sequential sequence number. This number wraps around. The purpose of the SEQNO is to detect looping programs.

A STATUS command will show the low order 6 digits of the sequence number. Only the last 6 digits are needed to do a REQABORT to terminate a transaction.