Progress0 of 0 lessons

CICS DELETE CONTAINER (BTS) - Business Transaction Services Container Deletion

CICS DELETE CONTAINER (BTS) provides Business Transaction Services container deletion and cleanup capabilities in CICS environments. It enables programs to delete BTS containers, clean up container resources, and remove container data from CICS applications.

What is CICS DELETE CONTAINER (BTS)?

CICS DELETE CONTAINER (BTS) is a command that allows programs to delete Business Transaction Services containers, clean up container resources, and remove container data from CICS environments. It provides BTS container deletion capabilities, resource cleanup, and container removal for CICS applications.

Command Syntax

cobol
1
2
3
4
5
6
EXEC CICS DELETE CONTAINER CONTAINER(container-name) [CHANNEL(channel-name)] [FORCE(force-option)] [RESP(response-code)] END-EXEC

Parameters

Required Parameters

  • CONTAINER - Name of the BTS container to delete

Optional Parameters

  • CHANNEL - Channel name containing the container
  • FORCE - Force deletion option
  • RESP - Response code variable

BTS Container Types

Data Containers

Containers that store business data

  • TRANSACTION DATA - Containers storing transaction-specific data
  • BUSINESS DATA - Containers storing business process data
  • REFERENCE DATA - Containers storing reference information
  • CONFIGURATION DATA - Containers storing configuration settings

Control Containers

Containers that control BTS operations

  • PROCESS CONTROL - Containers controlling process execution
  • WORKFLOW CONTROL - Containers controlling workflow operations
  • STATE CONTROL - Containers controlling state management
  • ROUTING CONTROL - Containers controlling message routing

Message Containers

Containers that handle message processing

  • INPUT MESSAGES - Containers storing incoming messages
  • OUTPUT MESSAGES - Containers storing outgoing messages
  • ERROR MESSAGES - Containers storing error information
  • STATUS MESSAGES - Containers storing status information

Temporary Containers

Containers used for temporary operations

  • WORK CONTAINERS - Containers used for temporary work
  • BUFFER CONTAINERS - Containers used as buffers
  • CACHE CONTAINERS - Containers used for caching
  • SCRATCH CONTAINERS - Containers used for scratch operations

Programming Examples

Basic Container Deletion

cobol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
IDENTIFICATION DIVISION. PROGRAM-ID. DELETE01. DATA DIVISION. WORKING-STORAGE SECTION. 01 CONTAINER-NAME PIC X(20) VALUE 'TRANSACTION_DATA'. 01 CHANNEL-NAME PIC X(20) VALUE 'MAIN_CHANNEL'. 01 RESPONSE-CODE PIC S9(8) COMP. PROCEDURE DIVISION. EXEC CICS DELETE CONTAINER CONTAINER(CONTAINER-NAME) CHANNEL(CHANNEL-NAME) RESP(RESPONSE-CODE) END-EXEC IF RESPONSE-CODE = DFHRESP(NORMAL) DISPLAY 'Container deleted successfully' ELSE DISPLAY 'Failed to delete container' END-IF EXEC CICS RETURN END-EXEC.

Forced Container Deletion

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
IDENTIFICATION DIVISION. PROGRAM-ID. DELETE02. DATA DIVISION. WORKING-STORAGE SECTION. 01 CONTAINER-NAME PIC X(20) VALUE 'BUSINESS_DATA'. 01 CHANNEL-NAME PIC X(20) VALUE 'PROCESS_CHANNEL'. 01 FORCE-OPTION PIC X(4) VALUE 'YES'. 01 RESPONSE-CODE PIC S9(8) COMP. PROCEDURE DIVISION. EXEC CICS DELETE CONTAINER CONTAINER(CONTAINER-NAME) CHANNEL(CHANNEL-NAME) FORCE(FORCE-OPTION) RESP(RESPONSE-CODE) END-EXEC IF RESPONSE-CODE = DFHRESP(NORMAL) DISPLAY 'Container force deleted' DISPLAY 'Container: ' CONTAINER-NAME DISPLAY 'Channel: ' CHANNEL-NAME DISPLAY 'Force: ' FORCE-OPTION ELSE DISPLAY 'Failed to force delete container' END-IF EXEC CICS RETURN END-EXEC.

Error Handling with Container Deletion

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
IDENTIFICATION DIVISION. PROGRAM-ID. DELETE03. DATA DIVISION. WORKING-STORAGE SECTION. 01 CONTAINER-NAME PIC X(20) VALUE 'MESSAGE_DATA'. 01 CHANNEL-NAME PIC X(20) VALUE 'MESSAGE_CHANNEL'. 01 RESPONSE-CODE PIC S9(8) COMP. PROCEDURE DIVISION. EXEC CICS DELETE CONTAINER CONTAINER(CONTAINER-NAME) CHANNEL(CHANNEL-NAME) RESP(RESPONSE-CODE) END-EXEC EVALUATE RESPONSE-CODE WHEN DFHRESP(NORMAL) DISPLAY 'Container deleted successfully' DISPLAY 'Container: ' CONTAINER-NAME WHEN DFHRESP(NOTFND) DISPLAY 'Container not found' WHEN DFHRESP(INVREQ) DISPLAY 'Invalid deletion request' WHEN DFHRESP(CONTAINERERR) DISPLAY 'Container-specific error occurred' WHEN DFHRESP(DELETEERR) DISPLAY 'Deletion-specific error occurred' WHEN OTHER DISPLAY 'Unexpected error occurred' END-EVALUATE EXEC CICS RETURN END-EXEC.

Container Cleanup

Data Cleanup

  • Data Removal - Remove all data stored in the container
  • Metadata Cleanup - Clean up container metadata and attributes
  • Index Cleanup - Remove indexes associated with the container
  • Reference Cleanup - Clear references to the container data

Resource Cleanup

  • Memory Cleanup - Release memory allocated to the container
  • Storage Cleanup - Release storage space used by the container
  • Buffer Cleanup - Clean up buffers used by the container
  • Cache Cleanup - Clear cache entries for the container

Channel Cleanup

  • Channel References - Remove references to the container in channels
  • Channel Metadata - Update channel metadata after container deletion
  • Channel Index - Update channel indexes after container removal
  • Channel State - Update channel state after container cleanup

System Cleanup

  • System References - Remove system references to the container
  • Registry Cleanup - Remove container from system registry
  • Monitoring Cleanup - Remove container from monitoring systems
  • Audit Cleanup - Update audit logs after container deletion

Error Handling

Common Response Codes

  • DFHRESP(NORMAL) - Container deleted successfully
  • DFHRESP(NOTFND) - Container not found
  • DFHRESP(INVREQ) - Invalid deletion request
  • DFHRESP(CONTAINERERR) - Container-specific error
  • DFHRESP(DELETEERR) - Deletion-specific error
  • DFHRESP(CLEANUPERR) - Cleanup-specific error

Performance Considerations

Deletion Efficiency

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

Resource Impact

  • Monitor resource usage - Track how deletion operations consume system resources
  • Optimize resource cleanup - Ensure efficient cleanup of resources during deletion
  • Manage resource recovery - Properly recover resources after deletion operations
  • Track resource utilization - Monitor the overall resource consumption patterns

Best Practices

BTS Container Deletion Best Practices

  • • Always check response codes
  • • Use appropriate deletion parameters
  • • Implement proper error handling
  • • Ensure proper resource cleanup
  • • Validate container state before deletion
  • • Optimize deletion operations
  • • Clean up resources properly

Explain It Like I'm 5 Years Old

Think of CICS DELETE CONTAINER (BTS) like throwing away a box:

  • Box Name: "Which box to throw away" - The container name
  • Room: "Which room the box is in" - The channel name
  • Force Throw: "Throw it away even if it's heavy" - The force option
  • Empty the Box: "Take everything out first" - Data cleanup
  • All Gone: "Box is completely gone" - Container deleted

Exercises

Exercise 1: Basic Container Deletion

Create a program that deletes a basic BTS container with standard parameters.

Exercise 2: Forced Deletion

Write a program that performs forced deletion of a BTS container.

Exercise 3: Error Handling

Implement comprehensive error handling for container deletion failures and cleanup errors.