Progress0 of 0 lessons

CICS PUT CONTAINER (CHANNEL) - Channel Container Storage

CICS PUT CONTAINER (CHANNEL) provides channel container storage capabilities for programs and transactions. It enables programs to store data in channel containers, manage channel data storage, and handle channel container operations in CICS environments.

What is CICS PUT CONTAINER (CHANNEL)?

CICS PUT CONTAINER (CHANNEL) is a command that allows programs to store data in channel containers. It provides channel data storage capabilities, container management, and channel container handling 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) - Name of channel to store container in
  • CONTAINER(container-name) - Name of container to store
  • FROM(data-area) - Data area containing data to store
  • LENGTH(data-length) - Length of data to store

Optional Parameters

  • RESP(response-code) - Response code variable

Channel Container Types

Data Containers

Containers with application data

  • APPLICATION DATA - Store application data container
  • BUSINESS DATA - Store business data container
  • TRANSACTION DATA - Store transaction data container
  • PROCESS DATA - Store process data container

Control Containers

Containers with control information

  • CONTROL DATA - Store control data container
  • STATUS DATA - Store status data container
  • CONFIGURATION DATA - Store configuration data container
  • METADATA - Store metadata container

Message Containers

Containers with message data

  • MESSAGE DATA - Store message data container
  • NOTIFICATION DATA - Store notification data container
  • ALERT DATA - Store alert data container
  • EVENT DATA - Store event data container

Custom Containers

User-defined containers

  • CUSTOM DATA - Store custom data container
  • USER DATA - Store user data container
  • WORKFLOW DATA - Store workflow data container
  • INTEGRATION DATA - Store integration data container

Programming Examples

Basic Channel 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
IDENTIFICATION DIVISION. PROGRAM-ID. PUTCONTAINERCHANNEL01. DATA DIVISION. WORKING-STORAGE SECTION. 01 CHANNEL-NAME PIC X(8) VALUE 'MAINCHAN'. 01 CONTAINER-NAME PIC X(8) VALUE 'DATACON1'. 01 DATA-AREA PIC X(100) VALUE 'Sample data for container'. 01 DATA-LENGTH PIC S9(8) COMP VALUE 100. 01 RESPONSE-CODE PIC S9(8) COMP. 01 CONTAINER-STORED PIC X(1) VALUE 'N'. PROCEDURE DIVISION. IF CONTAINER-STORED = 'N' DISPLAY 'Storing container: ' CONTAINER-NAME DISPLAY 'In channel: ' CHANNEL-NAME 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) MOVE 'Y' TO CONTAINER-STORED DISPLAY 'Container stored successfully' ELSE DISPLAY 'Failed to store container' END-IF ELSE DISPLAY 'Container already stored' END-IF EXEC CICS RETURN END-EXEC.

Advanced Channel Container Management

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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
IDENTIFICATION DIVISION. PROGRAM-ID. PUTCONTAINERCHANNEL02. DATA DIVISION. WORKING-STORAGE SECTION. 01 CHANNEL-NAME PIC X(8) VALUE 'MAINCHAN'. 01 CONTAINER-NAME PIC X(8). 01 DATA-AREA PIC X(200). 01 DATA-LENGTH PIC S9(8) COMP VALUE 200. 01 RESPONSE-CODE PIC S9(8) COMP. 01 CONTAINER-COUNT PIC S9(2) COMP VALUE 0. 01 MAX-CONTAINERS PIC S9(2) COMP VALUE 5. 01 TOTAL-DATA-LENGTH PIC S9(8) COMP VALUE 0. 01 CONTAINER-LIST. 05 CONTAINER-ITEM OCCURS 5 TIMES. 10 CONTAINER-ID PIC X(8). 10 CONTAINER-STATUS PIC X(1). 10 CONTAINER-SIZE PIC S9(8) COMP. PROCEDURE DIVISION. PERFORM STORE-MULTIPLE-CHANNEL-CONTAINERS DISPLAY 'Total data stored: ' TOTAL-DATA-LENGTH ' bytes' EXEC CICS RETURN END-EXEC. STORE-MULTIPLE-CHANNEL-CONTAINERS. MOVE 'CONTAIN1' TO CONTAINER-ID(1) MOVE 'CONTAIN2' TO CONTAINER-ID(2) MOVE 'CONTAIN3' TO CONTAINER-ID(3) MOVE 'CONTAIN4' TO CONTAINER-ID(4) MOVE 'CONTAIN5' TO CONTAINER-ID(5) PERFORM VARYING CONTAINER-COUNT FROM 1 BY 1 UNTIL CONTAINER-COUNT > MAX-CONTAINERS MOVE CONTAINER-ID(CONTAINER-COUNT) TO CONTAINER-NAME MOVE 'Sample data for container' TO DATA-AREA PERFORM STORE-SINGLE-CHANNEL-CONTAINER IF RESPONSE-CODE = DFHRESP(NORMAL) MOVE 'S' TO CONTAINER-STATUS(CONTAINER-COUNT) MOVE DATA-LENGTH TO CONTAINER-SIZE(CONTAINER-COUNT) ADD DATA-LENGTH TO TOTAL-DATA-LENGTH DISPLAY 'Stored: ' CONTAINER-NAME ' Size: ' DATA-LENGTH ELSE MOVE 'F' TO CONTAINER-STATUS(CONTAINER-COUNT) MOVE 0 TO CONTAINER-SIZE(CONTAINER-COUNT) DISPLAY 'Failed: ' CONTAINER-NAME END-IF END-PERFORM. STORE-SINGLE-CHANNEL-CONTAINER. EXEC CICS PUT CONTAINER CHANNEL(CHANNEL-NAME) CONTAINER(CONTAINER-NAME) FROM(DATA-AREA) LENGTH(DATA-LENGTH) RESP(RESPONSE-CODE) END-EXEC.

Error Handling with Channel 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
IDENTIFICATION DIVISION. PROGRAM-ID. PUTCONTAINERCHANNEL03. DATA DIVISION. WORKING-STORAGE SECTION. 01 CHANNEL-NAME PIC X(8) VALUE 'TESTCHAN'. 01 CONTAINER-NAME PIC X(8) VALUE 'TESTCON'. 01 DATA-AREA PIC X(50) VALUE 'Test data for container'. 01 DATA-LENGTH PIC S9(8) COMP VALUE 50. 01 RESPONSE-CODE PIC S9(8) COMP. 01 RETRY-COUNT PIC S9(2) COMP VALUE 0. 01 MAX-RETRIES PIC S9(2) COMP VALUE 3. 01 STORAGE-SUCCESSFUL PIC X(1) VALUE 'N'. PROCEDURE DIVISION. PERFORM STORE-CHANNEL-CONTAINER-WITH-ERROR-HANDLING EXEC CICS RETURN END-EXEC. STORE-CHANNEL-CONTAINER-WITH-ERROR-HANDLING. PERFORM STORE-CHANNEL-CONTAINER IF RESPONSE-CODE NOT = DFHRESP(NORMAL) AND RETRY-COUNT < MAX-RETRIES ADD 1 TO RETRY-COUNT DISPLAY 'Retry ' RETRY-COUNT ' storing channel container' PERFORM STORE-CHANNEL-CONTAINER-WITH-ERROR-HANDLING END-IF. STORE-CHANNEL-CONTAINER. 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) MOVE 'Y' TO STORAGE-SUCCESSFUL DISPLAY 'Channel container stored successfully' WHEN DFHRESP(NOTFND) DISPLAY 'Channel not found' WHEN DFHRESP(NOTAUTH) DISPLAY 'Not authorized to store container' WHEN DFHRESP(INVREQ) DISPLAY 'Invalid container request' WHEN DFHRESP(CONTAINERERR) DISPLAY 'Container storage error' WHEN OTHER DISPLAY 'Unexpected error occurred' END-EVALUATE.

Channel Container Management

Container Storage

  • Container Authorization - Control container storage permissions
  • Container Validation - Validate container storage requests
  • Container Limits - Enforce container storage limits
  • Container Policies - Implement container storage policies

Container Monitoring

  • Container Tracking - Track container storage activities
  • Container Logging - Log container operations
  • Container Auditing - Audit container storage requests
  • Container Reporting - Generate container storage reports

Container Lifecycle

  • Container Creation - Create new channel containers
  • Container Initialization - Initialize channel containers
  • Container Processing - Process channel container data
  • Container Cleanup - Clean up channel container resources

Error Recovery

  • Error Detection - Detect channel container errors
  • Error Recovery - Recover from channel container errors
  • Retry Mechanisms - Implement retry logic
  • Fallback Procedures - Use fallback procedures

Error Handling

Common Response Codes

  • DFHRESP(NORMAL) - Channel container stored successfully
  • DFHRESP(NOTFND) - Channel not found
  • DFHRESP(NOTAUTH) - Not authorized to store container
  • DFHRESP(INVREQ) - Invalid container request
  • DFHRESP(CONTAINERERR) - Container storage error
  • DFHRESP(CONTAINERMANAGEMENTERR) - Container management error

Performance Considerations

Container Efficiency

  • Optimize container operations - Use efficient container handling
  • Minimize container overhead - Reduce container processing overhead
  • Use container pooling - Implement container pooling
  • Monitor container frequency - Track container storage patterns

System Impact

  • Monitor system impact - Track how containers affect the system
  • Optimize container handling - Ensure efficient container processing
  • Manage container usage - Monitor container consumption
  • Track performance metrics - Monitor container handling performance

Best Practices

Channel Container Management Best Practices

  • • Store channel containers only when needed
  • • Implement proper error handling for container operations
  • • Validate container requests before processing
  • • Use appropriate container storage methods
  • • Monitor container storage activities and performance
  • • Maintain container audit trails
  • • Handle container errors gracefully

Explain It Like I'm 5 Years Old

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

  • Find Toy Box: "Find the right toy box" - Locate channel
  • Open Toy Box: "Open the toy box" - Access channel
  • Put Toy In: "Put your toy in the box" - Store container data
  • Close Toy Box: "Close the toy box" - Complete storage
  • Remember Where: "Remember where you put it" - Track container

Exercises

Exercise 1: Basic Channel Container Storage

Create a program that stores a specific container in a channel.

Exercise 2: Advanced Channel Container Management

Write a program that manages multiple channel container storage operations.

Exercise 3: Error Handling

Implement comprehensive error handling for channel container storage failures.