CclBuf class

A CclBuf object contains a data area in memory that can be used to hold information. A particular use for a CclBuf object is to hold a COMMAREA, which passes data to and from a CICS® server.

The CclBuf object is primarily intended for use with byte (binary) data. A typical COMMAREA contains an application-specific data structure, often originating from a CICS server PL/l or C program. Methods such as assign() and insert() therefore provide a void* parameter type for application data input. There is limited support for SBCS null-terminated strings (some of the code samples use this), but there is no code-page conversion or DBCS support in the CclBuf class.

The maximum data length for a buffer is the maximum value for unsigned long (232) for 32-bit platforms. CICS imposes a limit of 32 KB in COMMAREAs. This can be reduced by setting the MaxBufferSize parameter in the CICS Transaction Gateway configuration file (ctg.ini). See Maximum buffer size for more information. If a buffer object used as a COMMAREA is too long, a data length exception is raised.

When a CclBuf object is created it either uses an area of memory passed to it as its buffer, or allocates its own. The length of the data in this buffer can be reduced after the CclBuf object is created. The length of the data in this buffer can only be increased beyond the original length if the CclBuf object is created with a DataAreaType of extensible, rather than fixed.

If a buffer object has a DataAreaType of fixed and a method is called which would result in its data area length being exceeded, a buffer overflow exception is raised. If the exception is not handled, the buffer will contain the result of the call, truncated to the data area length.

If a method is called that results in a buffer object having a data length smaller than its data area length, the data is padded with nulls.

Many of the methods return object references. This makes it possible for users to chain calls to member functions. For example, the code:
CclBuf comma1;
comma1="Some text";
comma1.insert( 9,"inserted ",5) += " at the end";
would create the following string:
Some inserted text at the end

Information Information

Feedback


Timestamp icon Last updated: Tuesday, 19 November 2013


https://ut-ilnx-r4.hursley.ibm.com/tg_latest/help/topic/com.ibm.cics.tg.doc//proref/cclbuf.html