Progress0 of 0 lessons

CICS PUT CONTAINER (BTS) - BTS Container Data Storage

CICS PUT CONTAINER (BTS) provides Business Transaction Services container data storage capabilities in CICS environments. It enables programs to store data in BTS containers, manage container data, and handle BTS container operations in CICS applications.

What is CICS PUT CONTAINER (BTS)?

CICS PUT CONTAINER (BTS) is a command that allows programs to store data in Business Transaction Services containers, manage container data, and handle BTS container operations in CICS environments. It provides BTS container data storage capabilities, data management, and container operations for CICS applications.

Command Syntax

cobol
1
2
3
4
5
6
7
EXEC CICS PUT CONTAINER [CHANNEL(channel-name)] [CONTAINER(container-name)] [FROM(data-area)] [LENGTH(data-length)] [RESP(response-code)] END-EXEC

Parameters

Required Parameters

  • CHANNEL - Channel name containing the container
  • CONTAINER - Container name to store data
  • FROM - Data area containing data to store

Optional Parameters

  • LENGTH - Length of data to store
  • RESP - Response code variable

BTS Container Data Storage Types

Data Storage

Store various types of data in containers

  • STRUCTURED DATA - Store structured data with defined formats and schemas
  • UNSTRUCTURED DATA - Store unstructured data without predefined formats
  • BINARY DATA - Store binary data and binary-encoded information
  • TEXT DATA - Store text data and character-based information

Data Management

Manage container data operations

  • DATA OVERWRITE - Overwrite existing data in containers with new data
  • DATA APPEND - Append new data to existing data in containers
  • DATA REPLACE - Replace specific portions of data in containers
  • DATA UPDATE - Update existing data in containers with modified information

Container Management

Manage container lifecycle and operations

  • CONTAINER CREATION - Create new containers for data storage
  • CONTAINER MODIFICATION - Modify existing containers and their properties
  • CONTAINER VALIDATION - Validate container data and integrity
  • CONTAINER OPTIMIZATION - Optimize container storage and performance

Channel Management

Manage channel operations and data flow

  • CHANNEL DATA FLOW - Manage data flow through channels and containers
  • CHANNEL VALIDATION - Validate channel operations and data integrity
  • CHANNEL OPTIMIZATION - Optimize channel performance and data handling
  • CHANNEL MONITORING - Monitor channel operations and data storage

Programming Examples

Basic Container Data Storage

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
IDENTIFICATION DIVISION. PROGRAM-ID. PUTCONTAINER01. DATA DIVISION. WORKING-STORAGE SECTION. 01 CHANNEL-NAME PIC X(20) VALUE 'MAIN_CHANNEL'. 01 CONTAINER-NAME PIC X(20) VALUE 'DATA_CONTAINER'. 01 DATA-AREA PIC X(1000) VALUE 'Sample data for storage'. 01 DATA-LENGTH PIC S9(8) COMP VALUE 20. 01 RESPONSE-CODE PIC S9(8) COMP. PROCEDURE DIVISION. EXEC CICS PUT CONTAINER CHANNEL(CHANNEL-NAME) CONTAINER(CONTAINER-NAME) FROM(DATA-AREA) LENGTH(DATA-LENGTH) RESP(RESPONSE-CODE) END-EXEC IF RESPONSE-CODE = DFHRESP(NORMAL) DISPLAY 'Data stored successfully' DISPLAY 'Channel: ' CHANNEL-NAME DISPLAY 'Container: ' CONTAINER-NAME DISPLAY 'Data length: ' DATA-LENGTH ELSE DISPLAY 'Failed to store data' END-IF EXEC CICS RETURN END-EXEC.

Multiple Container Data Storage

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
IDENTIFICATION DIVISION. PROGRAM-ID. PUTCONTAINER02. DATA DIVISION. WORKING-STORAGE SECTION. 01 CHANNEL-NAME PIC X(20) VALUE 'PROCESS_CHANNEL'. 01 CONTAINER-NAME PIC X(20). 01 DATA-AREA PIC X(1000). 01 DATA-LENGTH PIC S9(8) COMP. 01 RESPONSE-CODE PIC S9(8) COMP. 01 CONTAINER-COUNT PIC 9(3) VALUE 0. PROCEDURE DIVISION. PERFORM VARYING CONTAINER-COUNT FROM 1 BY 1 UNTIL CONTAINER-COUNT > 3 STRING 'CONTAINER_' CONTAINER-COUNT DELIMITED BY SIZE INTO CONTAINER-NAME STRING 'Data for container ' CONTAINER-COUNT DELIMITED BY SIZE INTO DATA-AREA COMPUTE DATA-LENGTH = 20 + CONTAINER-COUNT EXEC CICS PUT CONTAINER CHANNEL(CHANNEL-NAME) CONTAINER(CONTAINER-NAME) FROM(DATA-AREA) LENGTH(DATA-LENGTH) RESP(RESPONSE-CODE) END-EXEC IF RESPONSE-CODE = DFHRESP(NORMAL) DISPLAY 'Container ' CONTAINER-COUNT ' stored successfully' ELSE DISPLAY 'Failed to store container ' CONTAINER-COUNT END-IF END-PERFORM EXEC CICS RETURN END-EXEC.

Error Handling with Container Storage

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
IDENTIFICATION DIVISION. PROGRAM-ID. PUTCONTAINER03. DATA DIVISION. WORKING-STORAGE SECTION. 01 CHANNEL-NAME PIC X(20) VALUE 'MESSAGE_CHANNEL'. 01 CONTAINER-NAME PIC X(20) VALUE 'MESSAGE_CONTAINER'. 01 DATA-AREA PIC X(1000) VALUE 'Error handling test data'. 01 DATA-LENGTH PIC S9(8) COMP VALUE 25. 01 RESPONSE-CODE PIC S9(8) COMP. PROCEDURE DIVISION. EXEC CICS PUT CONTAINER CHANNEL(CHANNEL-NAME) CONTAINER(CONTAINER-NAME) FROM(DATA-AREA) LENGTH(DATA-LENGTH) RESP(RESPONSE-CODE) END-EXEC EVALUATE RESPONSE-CODE WHEN DFHRESP(NORMAL) DISPLAY 'Data stored successfully' DISPLAY 'Channel: ' CHANNEL-NAME DISPLAY 'Container: ' CONTAINER-NAME WHEN DFHRESP(INVREQ) DISPLAY 'Invalid storage request' WHEN DFHRESP(CONTAINERERR) DISPLAY 'Container-specific error occurred' WHEN DFHRESP(CHANNELERR) DISPLAY 'Channel-specific error occurred' WHEN DFHRESP(AUTHORITYERR) DISPLAY 'Authorization error occurred' WHEN OTHER DISPLAY 'Unexpected error occurred' END-EVALUATE EXEC CICS RETURN END-EXEC.

BTS Container Data Management

Data Storage Management

  • Storage Allocation - Allocate storage space for container data
  • Storage Optimization - Optimize storage usage and efficiency
  • Storage Monitoring - Monitor storage usage and performance
  • Storage Cleanup - Clean up storage resources after operations

Container Management

  • Container Lifecycle - Manage container creation, modification, and deletion
  • Container Validation - Validate container data and integrity
  • Container Optimization - Optimize container performance and storage
  • Container Monitoring - Monitor container operations and status

Channel Management

  • Channel Operations - Manage channel operations and data flow
  • Channel Validation - Validate channel operations and data integrity
  • Channel Optimization - Optimize channel performance and data handling
  • Channel Monitoring - Monitor channel operations and data storage

Error Management

  • Error Detection - Detect errors during storage operations
  • Error Recovery - Recover from storage operation errors
  • Error Reporting - Report storage operation errors
  • Error Prevention - Prevent future storage operation errors

Error Handling

Common Response Codes

  • DFHRESP(NORMAL) - Data stored successfully
  • DFHRESP(INVREQ) - Invalid storage request
  • DFHRESP(CONTAINERERR) - Container-specific error
  • DFHRESP(CHANNELERR) - Channel-specific error
  • DFHRESP(AUTHORITYERR) - Authorization error
  • DFHRESP(STORAGEERR) - Storage-specific error

Performance Considerations

Storage Efficiency

  • Optimize storage operations - Use appropriate storage methods for different data types
  • Minimize storage overhead - Reduce the computational cost of storage operations
  • Use efficient storage patterns - Implement storage strategies that minimize resource usage
  • Monitor storage performance - Track the performance impact of storage operations

Resource Impact

  • Monitor resource usage - Track how storage operations consume system resources
  • Optimize resource allocation - Ensure efficient allocation of resources for storage
  • Manage resource cleanup - Properly clean up resources after storage operations
  • Track resource utilization - Monitor the overall resource consumption patterns

Best Practices

BTS Container Data Storage Best Practices

  • • Always check response codes
  • • Use appropriate storage parameters
  • • Implement proper error handling
  • • Ensure proper data validation
  • • Validate storage operations
  • • Optimize storage operations
  • • Clean up resources properly

Explain It Like I'm 5 Years Old

Think of CICS PUT CONTAINER (BTS) like putting toys in a toy box:

  • Room Name: "Which room to put the toy box in" - The channel name
  • Toy Box Name: "Which toy box to put toys in" - The container name
  • Put Toys In: "Put toys in the toy box" - Store data in container
  • Count Toys: "Count how many toys you put in" - Track data length
  • All Done: "Finished putting toys in the toy box" - Data stored successfully

Exercises

Exercise 1: Basic Container Data Storage

Create a program that stores data in BTS containers using PUT CONTAINER.

Exercise 2: Multiple Container Storage

Write a program that stores data in multiple containers using PUT CONTAINER.

Exercise 3: Error Handling

Implement comprehensive error handling for container storage failures and invalid operations.