MainframeMaster
Progress0 of 0 lessons

CICS EXTRACT ATTRIBUTES (APPC) - APPC Attribute Extraction

CICS EXTRACT ATTRIBUTES (APPC) extracts attributes and information from APPC sessions. It enables programs to retrieve APPC session attributes, manage session information, and handle APPC attribute extraction in CICS environments.

What is CICS EXTRACT ATTRIBUTES (APPC)?

CICS EXTRACT ATTRIBUTES (APPC) is a command that allows programs to extract attributes and information from APPC sessions. It provides session information retrieval capabilities, attribute management, and session monitoring for CICS applications.

Command Syntax

cobol
1
2
3
4
5
6
7
8
9
10
EXEC CICS EXTRACT ATTRIBUTES CONVID(conversation-id) [SESSION(session-name)] [SYSTEM(system-name)] [USERID(user-id)] [PASSWORD(password)] [SYNCLEVEL(sync-level)] [STATE(state-value)] [RESP(response-code)] END-EXEC

Parameters

Required Parameters

  • CONVID(conversation-id) - Conversation ID for the APPC session

Optional Parameters

  • SESSION(session-name) - Session name variable
  • SYSTEM(system-name) - System name variable
  • USERID(user-id) - User ID variable
  • PASSWORD(password) - Password variable
  • SYNCLEVEL(sync-level) - Synchronization level variable
  • STATE(state-value) - State value variable
  • RESP(response-code) - Response code variable

APPC Attribute Types

Session Attributes

Information about the APPC session

  • SESSION NAME - Name of the APPC session
  • CONVERSATION ID - Unique conversation identifier
  • SESSION STATE - Current state of the session
  • SESSION STATUS - Status of the session

System Attributes

Information about the remote system

  • SYSTEM NAME - Name of the remote system
  • SYSTEM TYPE - Type of the remote system
  • SYSTEM STATUS - Status of the remote system
  • NETWORK INFO - Network information

Security Attributes

Security and authentication information

  • USER ID - User identifier
  • PASSWORD - Password information
  • AUTHENTICATION - Authentication status
  • AUTHORIZATION - Authorization level

Communication Attributes

Communication and synchronization information

  • SYNC LEVEL - Synchronization level
  • COMMUNICATION MODE - Communication mode
  • PROTOCOL INFO - Protocol information
  • PERFORMANCE INFO - Performance metrics

Programming Examples

Basic Attribute 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
IDENTIFICATION DIVISION. PROGRAM-ID. EXTRACT01. DATA DIVISION. WORKING-STORAGE SECTION. 01 CONVERSATION-ID PIC X(8) VALUE 'CONV001'. 01 SESSION-NAME PIC X(8). 01 SYSTEM-NAME PIC X(8). 01 USER-ID PIC X(8). 01 SYNC-LEVEL PIC S9(4) COMP. 01 STATE-VALUE PIC S9(4) COMP. 01 RESPONSE-CODE PIC S9(8) COMP. PROCEDURE DIVISION. EXEC CICS EXTRACT ATTRIBUTES CONVID(CONVERSATION-ID) SESSION(SESSION-NAME) SYSTEM(SYSTEM-NAME) USERID(USER-ID) SYNCLEVEL(SYNC-LEVEL) STATE(STATE-VALUE) RESP(RESPONSE-CODE) END-EXEC IF RESPONSE-CODE = DFHRESP(NORMAL) DISPLAY 'Attributes extracted successfully' DISPLAY 'Session: ' SESSION-NAME DISPLAY 'System: ' SYSTEM-NAME DISPLAY 'User: ' USER-ID DISPLAY 'Sync Level: ' SYNC-LEVEL DISPLAY 'State: ' STATE-VALUE ELSE DISPLAY 'Failed to extract attributes' END-IF EXEC CICS RETURN END-EXEC.

Advanced Attribute 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
IDENTIFICATION DIVISION. PROGRAM-ID. EXTRACT02. DATA DIVISION. WORKING-STORAGE SECTION. 01 CONVERSATION-ID PIC X(8) VALUE 'CONV002'. 01 SESSION-NAME PIC X(8). 01 SYSTEM-NAME PIC X(8). 01 USER-ID PIC X(8). 01 PASSWORD PIC X(8). 01 SYNC-LEVEL PIC S9(4) COMP. 01 STATE-VALUE PIC S9(4) COMP. 01 RESPONSE-CODE PIC S9(8) COMP. 01 ATTRIBUTE-COUNT PIC S9(2) COMP VALUE 0. PROCEDURE DIVISION. PERFORM EXTRACT-ATTRIBUTES IF RESPONSE-CODE = DFHRESP(NORMAL) DISPLAY 'All attributes extracted successfully' DISPLAY 'Attribute count: ' ATTRIBUTE-COUNT PERFORM DISPLAY-ATTRIBUTES ELSE DISPLAY 'Failed to extract attributes' END-IF EXEC CICS RETURN END-EXEC. EXTRACT-ATTRIBUTES. EXEC CICS EXTRACT ATTRIBUTES CONVID(CONVERSATION-ID) SESSION(SESSION-NAME) SYSTEM(SYSTEM-NAME) USERID(USER-ID) PASSWORD(PASSWORD) SYNCLEVEL(SYNC-LEVEL) STATE(STATE-VALUE) RESP(RESPONSE-CODE) END-EXEC IF RESPONSE-CODE = DFHRESP(NORMAL) ADD 1 TO ATTRIBUTE-COUNT END-IF. DISPLAY-ATTRIBUTES. DISPLAY 'Session Name: ' SESSION-NAME DISPLAY 'System Name: ' SYSTEM-NAME DISPLAY 'User ID: ' USER-ID DISPLAY 'Sync Level: ' SYNC-LEVEL DISPLAY 'State: ' STATE-VALUE.

Error Handling with Attribute 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
IDENTIFICATION DIVISION. PROGRAM-ID. EXTRACT03. DATA DIVISION. WORKING-STORAGE SECTION. 01 CONVERSATION-ID PIC X(8) VALUE 'CONV003'. 01 SESSION-NAME PIC X(8). 01 SYSTEM-NAME PIC X(8). 01 RESPONSE-CODE PIC S9(8) COMP. PROCEDURE DIVISION. EXEC CICS EXTRACT ATTRIBUTES CONVID(CONVERSATION-ID) SESSION(SESSION-NAME) SYSTEM(SYSTEM-NAME) RESP(RESPONSE-CODE) END-EXEC EVALUATE RESPONSE-CODE WHEN DFHRESP(NORMAL) DISPLAY 'Attributes extracted successfully' WHEN DFHRESP(NOTFND) DISPLAY 'Conversation not found' WHEN DFHRESP(INVREQ) DISPLAY 'Invalid extraction request' WHEN DFHRESP(APPCERR) DISPLAY 'APPC-specific error occurred' WHEN DFHRESP(NOTAUTH) DISPLAY 'Not authorized to extract attributes' WHEN OTHER DISPLAY 'Unexpected error occurred' END-EVALUATE EXEC CICS RETURN END-EXEC.

Attribute Management

Attribute Retrieval

  • Session Information - Retrieve session attributes
  • System Information - Get system attributes
  • Security Information - Extract security attributes
  • Communication Info - Get communication attributes

Attribute Processing

  • Attribute Validation - Validate extracted attributes
  • Attribute Processing - Process attribute information
  • Attribute Storage - Store attribute data
  • Attribute Display - Display attribute information

Session Monitoring

  • Session Status - Monitor session status
  • Session Health - Check session health
  • Session Performance - Monitor session performance
  • Session Troubleshooting - Troubleshoot session issues

Error Recovery

  • Error Detection - Detect extraction errors
  • Error Recovery - Recover from extraction errors
  • Error Reporting - Report extraction errors
  • Error Prevention - Prevent extraction errors

Error Handling

Common Response Codes

  • DFHRESP(NORMAL) - Attributes extracted successfully
  • DFHRESP(NOTFND) - Conversation not found
  • DFHRESP(INVREQ) - Invalid extraction request
  • DFHRESP(APPCERR) - APPC-specific error
  • DFHRESP(NOTAUTH) - Not authorized to extract attributes
  • DFHRESP(LENGERR) - Data area length error

Performance Considerations

Extraction Efficiency

  • Optimize extraction patterns - Use appropriate extraction patterns for different scenarios
  • Minimize extraction overhead - Reduce the computational cost of extractions
  • Use efficient extraction strategies - Implement extraction strategies that minimize resource usage
  • Monitor extraction performance - Track the performance impact of extractions

Resource Impact

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

Best Practices

Attribute Extraction Best Practices

  • • Always check response codes
  • • Use appropriate extraction parameters
  • • Implement proper error handling
  • • Ensure proper attribute management
  • • Validate extracted attributes
  • • Optimize extraction operations
  • • Clean up resources properly

Explain It Like I'm 5 Years Old

Think of CICS EXTRACT ATTRIBUTES (APPC) like asking about a friend:

  • Ask Questions: "What's your friend's name?" - Extract session name
  • Get Information: "Where does your friend live?" - Extract system name
  • Learn More: "What does your friend like to do?" - Extract user info
  • Find Out: "How does your friend communicate?" - Extract sync level
  • Know Everything: "Now you know all about your friend" - All attributes extracted

Exercises

Exercise 1: Basic Attribute Extraction

Create a program that extracts basic attributes from an APPC session.

Exercise 2: Comprehensive Attribute Extraction

Write a program that extracts all available attributes and displays them.

Exercise 3: Error Handling

Implement comprehensive error handling for attribute extraction failures.