Progress0 of 0 lessons

CICS EXTRACT PROCESS - Process Information Extraction

CICS EXTRACT PROCESS provides process information extraction capabilities for programs and transactions. It enables programs to extract process information, retrieve process attributes, and handle process information in CICS environments.

What is CICS EXTRACT PROCESS?

CICS EXTRACT PROCESS is a command that allows programs to extract process information from the system. It provides process information extraction capabilities, process attributes retrieval, and process information processing for CICS applications.

Command Syntax

cobol
1
2
3
4
5
EXEC CICS EXTRACT PROCESS INTO(data-area) [LENGTH(data-length)] [RESP(response-code)] END-EXEC

Parameters

Required Parameters

  • INTO(data-area) - Data area to receive process information

Optional Parameters

  • LENGTH(data-length) - Length of process information
  • RESP(response-code) - Response code variable

Process Information Types

Process Attributes

Basic process attributes

  • PROCESS ID - Process identifier
  • PROCESS NAME - Process name
  • PROCESS STATUS - Process status
  • PROCESS TYPE - Process type

Process State

Process state information

  • RUNNING - Process is running
  • WAITING - Process is waiting
  • BLOCKED - Process is blocked
  • TERMINATED - Process is terminated

Process Resources

Process resource information

  • MEMORY USAGE - Memory usage
  • CPU USAGE - CPU usage
  • I/O USAGE - I/O usage
  • RESOURCE LIMITS - Resource limits

Process Environment

Process environment information

  • ENVIRONMENT VARIABLES - Environment variables
  • WORKING DIRECTORY - Working directory
  • USER CONTEXT - User context
  • SECURITY CONTEXT - Security context

Programming Examples

Basic Process Information Extraction

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
IDENTIFICATION DIVISION. PROGRAM-ID. EXTRACTPROCESS01. DATA DIVISION. WORKING-STORAGE SECTION. 01 PROCESS-INFO PIC X(200). 01 INFO-LENGTH PIC S9(4) COMP. 01 RESPONSE-CODE PIC S9(8) COMP. PROCEDURE DIVISION. DISPLAY 'Extracting process information' EXEC CICS EXTRACT PROCESS INTO(PROCESS-INFO) LENGTH(INFO-LENGTH) RESP(RESPONSE-CODE) END-EXEC IF RESPONSE-CODE = DFHRESP(NORMAL) DISPLAY 'Process information extracted successfully' DISPLAY 'Information: ' PROCESS-INFO(1:INFO-LENGTH) DISPLAY 'Length: ' INFO-LENGTH ELSE DISPLAY 'Failed to extract process information' END-IF EXEC CICS RETURN END-EXEC.

Advanced Process Information Processing

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
IDENTIFICATION DIVISION. PROGRAM-ID. EXTRACTPROCESS02. DATA DIVISION. WORKING-STORAGE SECTION. 01 PROCESS-INFO PIC X(200). 01 INFO-LENGTH PIC S9(4) COMP. 01 RESPONSE-CODE PIC S9(8) COMP. 01 EXTRACTION-COUNT PIC S9(2) COMP VALUE 0. 01 MAX-EXTRACTIONS PIC S9(2) COMP VALUE 3. 01 PROCESS-LIST. 05 PROCESS-ITEM OCCURS 3 TIMES. 10 PROCESS-CONTENT PIC X(200). 10 PROCESS-LEN PIC S9(4) COMP. 10 PROCESS-TYPE PIC X(10). PROCEDURE DIVISION. PERFORM EXTRACT-MULTIPLE-PROCESS-INFO EXEC CICS RETURN END-EXEC. EXTRACT-MULTIPLE-PROCESS-INFO. PERFORM VARYING EXTRACTION-COUNT FROM 1 BY 1 UNTIL EXTRACTION-COUNT > MAX-EXTRACTIONS PERFORM EXTRACT-SINGLE-PROCESS-INFO IF RESPONSE-CODE = DFHRESP(NORMAL) MOVE PROCESS-INFO TO PROCESS-CONTENT(EXTRACTION-COUNT) MOVE INFO-LENGTH TO PROCESS-LEN(EXTRACTION-COUNT) PERFORM DETERMINE-PROCESS-TYPE DISPLAY 'Extracted process info ' EXTRACTION-COUNT ': ' PROCESS-TYPE(EXTRACTION-COUNT) DISPLAY 'Content: ' PROCESS-CONTENT(EXTRACTION-COUNT)(1:PROCESS-LEN(EXTRACTION-COUNT)) ELSE DISPLAY 'Failed to extract process info ' EXTRACTION-COUNT END-IF END-PERFORM. EXTRACT-SINGLE-PROCESS-INFO. EXEC CICS EXTRACT PROCESS INTO(PROCESS-INFO) LENGTH(INFO-LENGTH) RESP(RESPONSE-CODE) END-EXEC. DETERMINE-PROCESS-TYPE. IF PROCESS-CONTENT(EXTRACTION-COUNT)(1:10) = 'PROCESS ID' MOVE 'IDENTIFIER' TO PROCESS-TYPE(EXTRACTION-COUNT) ELSE IF PROCESS-CONTENT(EXTRACTION-COUNT)(1:10) = 'PROCESS NA' MOVE 'NAME' TO PROCESS-TYPE(EXTRACTION-COUNT) ELSE IF PROCESS-CONTENT(EXTRACTION-COUNT)(1:10) = 'PROCESS ST' MOVE 'STATUS' TO PROCESS-TYPE(EXTRACTION-COUNT) ELSE MOVE 'UNKNOWN' TO PROCESS-TYPE(EXTRACTION-COUNT) END-IF.

Error Handling with Process Information Extraction

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
IDENTIFICATION DIVISION. PROGRAM-ID. EXTRACTPROCESS03. DATA DIVISION. WORKING-STORAGE SECTION. 01 PROCESS-INFO PIC X(200). 01 INFO-LENGTH PIC S9(4) COMP. 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 EXTRACTION-SUCCESSFUL PIC X(1) VALUE 'N'. PROCEDURE DIVISION. PERFORM EXTRACT-PROCESS-INFO-WITH-RETRY EXEC CICS RETURN END-EXEC. EXTRACT-PROCESS-INFO-WITH-RETRY. PERFORM EXTRACT-PROCESS-INFO IF RESPONSE-CODE NOT = DFHRESP(NORMAL) AND RETRY-COUNT < MAX-RETRIES ADD 1 TO RETRY-COUNT DISPLAY 'Retry ' RETRY-COUNT ' process information extraction' PERFORM EXTRACT-PROCESS-INFO-WITH-RETRY END-IF. EXTRACT-PROCESS-INFO. EXEC CICS EXTRACT PROCESS INTO(PROCESS-INFO) LENGTH(INFO-LENGTH) RESP(RESPONSE-CODE) END-EXEC EVALUATE RESPONSE-CODE WHEN DFHRESP(NORMAL) MOVE 'Y' TO EXTRACTION-SUCCESSFUL DISPLAY 'Process information extracted successfully' WHEN DFHRESP(NOTAUTH) DISPLAY 'Not authorized to extract process information' WHEN DFHRESP(INVREQ) DISPLAY 'Invalid process information extraction request' WHEN DFHRESP(PROCESSERR) DISPLAY 'Process information extraction error' WHEN DFHRESP(PROCESSNOTFOUND) DISPLAY 'Process information not found' WHEN DFHRESP(PROCESSLENGTHERR) DISPLAY 'Process information length error' WHEN OTHER DISPLAY 'Unexpected process information extraction error' END-EVALUATE.

Process Information Management

Information Extraction

  • Process Retrieval - Retrieve process information
  • Process Processing - Process process information
  • Process Validation - Validate process information
  • Process Formatting - Format process information

Process Analysis

  • Process Parsing - Parse process information
  • Process Classification - Classify process information
  • Process Filtering - Filter process information
  • Process Aggregation - Aggregate process information

Process Storage

  • Process Storage - Store process information
  • Process Archiving - Archive process information
  • Process Indexing - Index process information
  • Process Retrieval - Retrieve stored process information

Error Recovery

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

Error Handling

Common Response Codes

  • DFHRESP(NORMAL) - Process information extracted successfully
  • DFHRESP(NOTAUTH) - Not authorized to extract process information
  • DFHRESP(INVREQ) - Invalid process information extraction request
  • DFHRESP(PROCESSERR) - Process information extraction error
  • DFHRESP(PROCESSNOTFOUND) - Process information not found
  • DFHRESP(PROCESSLENGTHERR) - Process information length error

Performance Considerations

Process Efficiency

  • Optimize process operations - Use efficient process handling
  • Minimize process overhead - Reduce process processing overhead
  • Use process caching - Implement process caching
  • Monitor process frequency - Track process extraction patterns

System Impact

  • Monitor system impact - Track how process extraction affects the system
  • Optimize process handling - Ensure efficient process processing
  • Manage process usage - Monitor process consumption
  • Track performance metrics - Monitor process handling performance

Best Practices

Process Information Extraction Best Practices

  • • Extract process information only when needed
  • • Implement proper error handling for process operations
  • • Validate process information data before processing
  • • Use appropriate process management techniques
  • • Monitor process information activities and performance
  • • Maintain process information audit trails
  • • Handle process information errors gracefully

Explain It Like I'm 5 Years Old

Think of CICS EXTRACT PROCESS like asking about a friend:

  • Ask About Friend: "Ask about your friend" - Extract process info
  • Get Information: "Get information about your friend" - Receive process info
  • Understand Info: "Understand what the information means" - Process information
  • Use Information: "Use the information to help your friend" - Use process info
  • Keep Information: "Keep the information safe" - Store process info

Exercises

Exercise 1: Basic Process Information Extraction

Create a program that extracts basic process information.

Exercise 2: Advanced Process Information Processing

Write a program that processes multiple process information extractions.

Exercise 3: Error Handling

Implement comprehensive error handling for process information extraction failures.