Progress0 of 0 lessons

CICS INQUIRE CONTAINER - Container Inquiry Operations

CICS INQUIRE CONTAINER provides container inquiry capabilities in CICS environments. It enables programs to query container information, retrieve container details, and manage container inquiries in CICS applications.

What is CICS INQUIRE CONTAINER?

CICS INQUIRE CONTAINER is a command that allows programs to query container information, retrieve container details, and manage container inquiries in CICS environments. It provides container inquiry capabilities, status checking, and inquiry management for CICS applications.

Command Syntax

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

Parameters

Optional Parameters

  • CHANNEL - Channel name containing the container
  • CONTAINER - Container name to inquire about
  • INTO - Data area to receive container information
  • LENGTH - Length of data to retrieve
  • RESP - Response code variable

Container Inquiry Types

Status Inquiry

Query container status information

  • EXISTS STATUS - Check if container exists in the specified channel
  • ACCESSIBLE STATUS - Check if container is accessible for reading or writing
  • LOCKED STATUS - Check if container is currently locked by another process
  • EMPTY STATUS - Check if container is empty or contains data

Attribute Inquiry

Query container attribute information

  • CONTAINER ATTRIBUTES - Retrieve detailed container attribute information
  • SIZE ATTRIBUTES - Retrieve container size and capacity information
  • TYPE ATTRIBUTES - Retrieve container data type and format information
  • METADATA ATTRIBUTES - Retrieve container metadata and descriptive information

Content Inquiry

Query container content information

  • CONTENT SIZE - Retrieve the size of data stored in the container
  • CONTENT TYPE - Retrieve the type of data stored in the container
  • CONTENT FORMAT - Retrieve the format of data stored in the container
  • CONTENT ENCODING - Retrieve the encoding of data stored in the container

Relationship Inquiry

Query container relationship information

  • CHANNEL RELATIONSHIP - Retrieve information about the container's channel relationship
  • PARENT CONTAINERS - Retrieve information about parent or related containers
  • CHILD CONTAINERS - Retrieve information about child or dependent containers
  • DEPENDENCY RELATIONSHIPS - Retrieve information about container dependencies and relationships

Programming Examples

Basic Container Inquiry

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. INQUIRE01. 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). 01 DATA-LENGTH PIC S9(8) COMP. 01 RESPONSE-CODE PIC S9(8) COMP. PROCEDURE DIVISION. EXEC CICS INQUIRE CONTAINER CHANNEL(CHANNEL-NAME) CONTAINER(CONTAINER-NAME) INTO(DATA-AREA) LENGTH(DATA-LENGTH) RESP(RESPONSE-CODE) END-EXEC IF RESPONSE-CODE = DFHRESP(NORMAL) DISPLAY 'Container inquiry successful' DISPLAY 'Channel: ' CHANNEL-NAME DISPLAY 'Container: ' CONTAINER-NAME DISPLAY 'Data length: ' DATA-LENGTH ELSE DISPLAY 'Failed to inquire container' END-IF EXEC CICS RETURN END-EXEC.

Container Status Check

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. INQUIRE02. DATA DIVISION. WORKING-STORAGE SECTION. 01 CHANNEL-NAME PIC X(20) VALUE 'PROCESS_CHANNEL'. 01 CONTAINER-NAME PIC X(20) VALUE 'STATUS_CONTAINER'. 01 DATA-AREA PIC X(1000). 01 DATA-LENGTH PIC S9(8) COMP. 01 RESPONSE-CODE PIC S9(8) COMP. 01 CONTAINER-STATUS PIC X(10). PROCEDURE DIVISION. EXEC CICS INQUIRE CONTAINER CHANNEL(CHANNEL-NAME) CONTAINER(CONTAINER-NAME) INTO(DATA-AREA) LENGTH(DATA-LENGTH) RESP(RESPONSE-CODE) END-EXEC IF RESPONSE-CODE = DFHRESP(NORMAL) MOVE DATA-AREA(1:10) TO CONTAINER-STATUS DISPLAY 'Container Status: ' CONTAINER-STATUS EVALUATE CONTAINER-STATUS WHEN 'EXISTS' DISPLAY 'Container exists and is accessible' WHEN 'EMPTY' DISPLAY 'Container exists but is empty' WHEN 'LOCKED' DISPLAY 'Container is currently locked' WHEN 'NOTFOUND' DISPLAY 'Container does not exist' WHEN OTHER DISPLAY 'Unknown container status' END-EVALUATE ELSE DISPLAY 'Failed to check container status' END-IF EXEC CICS RETURN END-EXEC.

Error Handling with Container Inquiry

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. INQUIRE03. 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). 01 DATA-LENGTH PIC S9(8) COMP. 01 RESPONSE-CODE PIC S9(8) COMP. PROCEDURE DIVISION. EXEC CICS INQUIRE CONTAINER CHANNEL(CHANNEL-NAME) CONTAINER(CONTAINER-NAME) INTO(DATA-AREA) LENGTH(DATA-LENGTH) RESP(RESPONSE-CODE) END-EXEC EVALUATE RESPONSE-CODE WHEN DFHRESP(NORMAL) DISPLAY 'Container inquiry successful' DISPLAY 'Channel: ' CHANNEL-NAME DISPLAY 'Container: ' CONTAINER-NAME WHEN DFHRESP(NOTFND) DISPLAY 'Container not found' WHEN DFHRESP(INVREQ) DISPLAY 'Invalid inquiry request' WHEN DFHRESP(CONTAINERERR) DISPLAY 'Container-specific error occurred' WHEN DFHRESP(INQUIREERR) DISPLAY 'Inquiry-specific error occurred' WHEN OTHER DISPLAY 'Unexpected error occurred' END-EVALUATE EXEC CICS RETURN END-EXEC.

Container Inquiry Management

Inquiry State Management

  • Inquiry State Tracking - Track the current state of inquiry operations
  • Inquiry State Maintenance - Maintain inquiry state across operations
  • Inquiry Context Management - Manage inquiry context and environment
  • Inquiry Session Management - Manage inquiry session lifecycle

Container Management

  • Container Data Management - Manage container data during inquiry operations
  • Container State Management - Manage container state during inquiry operations
  • Container Metadata Management - Manage container metadata during inquiry operations
  • Container Access Management - Manage container access during inquiry operations

Channel Management

  • Channel State Management - Manage channel state during inquiry operations
  • Channel Context Management - Manage channel context during inquiry operations
  • Channel Access Management - Manage channel access during inquiry operations
  • Channel Session Management - Manage channel session lifecycle

Error Management

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

Error Handling

Common Response Codes

  • DFHRESP(NORMAL) - Container inquiry successful
  • DFHRESP(NOTFND) - Container not found
  • DFHRESP(INVREQ) - Invalid inquiry request
  • DFHRESP(CONTAINERERR) - Container-specific error
  • DFHRESP(INQUIREERR) - Inquiry-specific error
  • DFHRESP(AUTHORITYERR) - Authorization error

Performance Considerations

Inquiry Efficiency

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

Resource Impact

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

Best Practices

Container Inquiry Best Practices

  • • Always check response codes
  • • Use appropriate inquiry parameters
  • • Implement proper error handling
  • • Ensure proper inquiry state management
  • • Validate inquiry operations
  • • Optimize inquiry operations
  • • Clean up resources properly

Explain It Like I'm 5 Years Old

Think of CICS INQUIRE CONTAINER like asking about a box:

  • Room Name: "Which room to look in" - The channel name
  • Box Name: "Which box to ask about" - The container name
  • Ask Questions: "Ask about the box" - Inquire about container
  • Get Answers: "Get information about the box" - Receive container details
  • Check Status: "See if box is empty or full" - Check container status

Exercises

Exercise 1: Basic Container Inquiry

Create a program that inquires about container information using INQUIRE CONTAINER.

Exercise 2: Container Status Check

Write a program that checks the status of multiple containers using INQUIRE CONTAINER.

Exercise 3: Error Handling

Implement comprehensive error handling for container inquiry failures and invalid container names.