Joined: 14 Jan 2008 Posts: 2504 Location: Atlanta, Georgia, USA
A "non-shared" TSQ does not require exclusive control when being accessed. Typically, this would be a TSQ, whose name is associated with the transid and terminal-id (IE: TRN1TRM1). TSQ's like these are used to hold data outside of (or used in conjunction with), the transaction's commarea and is unique to the given task. They are normally built at the start of the task and should be deleted before task termination (your logic may vary).
A "shared" TSQ is a well-known TSQ, whose name is known by many other program's. To ensure TSQ data integrity (unless the TSQ is Read-Only with a fixed number of items), use of the CICS ENQ and DEQ API's are a necessity to ensure exclusive control. A unique and well-known RESOURCE name is necessary for these API's to work properly. It's best NOT to use the TSQ name as the RESOURCE name. You could use a RESOURCE name which includes the TSQ name, but surrounded by (or includes) different characters to ensure uniqueness. RESOURCE name's can be up to 255-Bytes in length. Also, TSQ names can optionally be 16-Bytes long.
Non-shared TSQ's can either be written to AUX or MAIN storage, whereas, shared TSQ's should be written to MAIN storage and will be automatically deleted when the region is brought down, unless there is a need for the TSQ to be RECOVERABLE, but this requirement is site specific.
Although issuing a DEQ API is optional, it is highly recommended in order to release exclusive control so that the next task can gain exclusive control. If an explicit DEQ is NOT issued, then an implict DEQ is issued by CICS at task termination.
For more information, review your applicable CICS APPLICATION PROGRAMMING REFERENCE and CICS APPLICATION PROGRAMMING GUIDE.