com.ibm.cics.server

Class TSQ

  • All Implemented Interfaces:
    java.io.Serializable


    public class TSQ
    extends RemotableResource
    This Class provides the Java interface to CICS Temporary Storage Queues (TSQs).

    A temporary storage (TS) queue is a set of data items that can be read and re-read in any sequence, and TSQ resources can be dynamically created at runtime. The following CICS temporary storage commands are supported: DELETEQ TS, READQ TS, and WRITEQ TS.

    Example writing to a TSQ:

    
         // Create an in memory temporary storage queue
         TSQ tsq = new TSQ();
         tsq.setType(TSQType.MAIN);
     
         // Set the TSQ name
         tsq.setName("TSQWRITE");
     
         // Write to the temporary storage queue
         String message = "Hello from JCICS";
         try
         {
             tsq.writeString(message);
         }
         catch (CicsConditionException cce)
         {
             cce.printStackTrace();
         }
     

    Example reading from a TSQ:

    
         // Create an ItemHolder to be used to read bytes from the TSQ
         ItemHolder holder = new ItemHolder();
     
         try
         {
             // Read item from the TSQ into the ItemHolder
             tsq.readNextItem(holder);
     
             // Extract the string data
             String strData = holder.getStringValue()
         }
         catch (CicsConditionException cce)
         {
             cce.printStackTrace();
         }
     

    Example reading a specific item from a TSQ:

    
         // Create an ItemHolder to be used to read bytes from the TSQ
         ItemHolder holder = new ItemHolder();
     
         try
         {
             // Read item number 2 from the TSQ into the ItemHolder
             // Note: TSQ item numbers start from 1, not zero
             int itemNumber = 2;
             tsq.readItem(itemNumber, holder);
     
             // Extract the string data
             String strData = holder.getStringValue()
         }
         catch (CicsConditionException cce)
         {
             cce.printStackTrace();
         }
     
    See Also:
    com.ibm.cics.server.API for general restrictions on using the JCICS API., Serialized Form
    Since CICS TS version:
    1.3
    Since package version:
    1.0.0