Progress0 of 0 lessons

CICS GDS EXTRACT ATTRIBUTES - Attribute Extraction

CICS GDS EXTRACT ATTRIBUTES retrieves conversation attributes and configuration information from an active General Data Stream (GDS) conversation in CICS APPC environments. It provides access to conversation state and characteristics.

What is CICS GDS EXTRACT ATTRIBUTES?

CICS GDS EXTRACT ATTRIBUTES retrieves current conversation attributes and configuration information from an active GDS conversation. It allows programs to examine conversation characteristics, state information, and configuration parameters for debugging and monitoring purposes.

Command Syntax

cobol
1
2
3
4
5
6
7
EXEC CICS GDS EXTRACT ATTRIBUTES CONVID(conversation-id) ATTRIBUTES(attribute-area) LENGTH(length-value) RESP(response-code) RESP2(response-code-2) END-EXEC.

Parameters Explained

CONVID Parameter

Specifies the conversation identifier:

  • Must be obtained from GDS ALLOCATE
  • Identifies the active conversation
  • Required for all GDS operations
  • Must be valid and active

ATTRIBUTES Parameter

Specifies the area to receive attributes:

  • Must be large enough for all attributes
  • Contains extracted attribute information
  • Format depends on conversation type
  • Must be properly aligned

LENGTH Parameter

Specifies the length of the attribute area:

  • Must be sufficient for all attributes
  • Minimum length requirements apply
  • Can be larger than required
  • Used for buffer overflow protection

Extracted Attributes

1. Conversation Attributes

  • CONV_TYPE: Conversation type
  • CONV_DIR: Conversation direction
  • CONV_STATE: Current conversation state
  • CONV_FLAGS: Conversation flags

2. Communication Attributes

  • SYNC_LEVEL: Synchronization level
  • CONFIRM: Confirmation requirements
  • DEALLOCATE: Deallocation behavior
  • SECURITY: Security level

3. Performance Attributes

  • BUFFER_SIZE: Buffer size
  • TIMEOUT: Timeout values
  • PRIORITY: Conversation priority
  • THROUGHPUT: Throughput requirements

Implementation Example

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
WORKING-STORAGE SECTION. 01 WS-CONVERSATION-ID PIC S9(8) COMP. 01 WS-RESPONSE PIC S9(8) COMP. 01 WS-RESPONSE2 PIC S9(8) COMP. 01 WS-ATTRIBUTE-LENGTH PIC S9(8) COMP VALUE 256. 01 WS-ATTRIBUTES. 05 WS-CONV-TYPE PIC X(1). 05 WS-CONV-DIR PIC X(1). 05 WS-CONV-STATE PIC X(1). 05 WS-SYNC-LEVEL PIC X(1). 05 WS-CONFIRM PIC X(1). 05 WS-SECURITY PIC X(1). 05 WS-BUFFER-SIZE PIC S9(8) COMP. 05 WS-TIMEOUT PIC S9(8) COMP. 05 WS-PRIORITY PIC S9(8) COMP. 05 FILLER PIC X(240). PROCEDURE DIVISION. EXEC CICS GDS EXTRACT ATTRIBUTES CONVID(WS-CONVERSATION-ID) ATTRIBUTES(WS-ATTRIBUTES) LENGTH(WS-ATTRIBUTE-LENGTH) RESP(WS-RESPONSE) RESP2(WS-RESPONSE2) END-EXEC. IF WS-RESPONSE NOT EQUAL DFHRESP(NORMAL) EXEC CICS WRITE OPERATOR TEXT('GDS EXTRACT ATTRIBUTES failed') END-EXEC EXEC CICS RETURN END-EXEC END-IF. * Attributes extracted successfully * Process attribute information

Attribute Usage

1. Debugging and Monitoring

Extracted attributes are useful for:

  • Conversation state verification
  • Configuration validation
  • Performance analysis
  • Error diagnosis

2. Dynamic Configuration

Attributes can be used for:

  • Runtime configuration changes
  • Adaptive behavior
  • Conditional processing
  • Performance optimization

Common Response Codes

Success Response Codes

  • NORMAL (0): Extraction successful
  • CONVERSATION (4): Attributes extracted

Error Response Codes

  • INVREQ (16): Invalid request
  • NOTFND (20): Conversation not found
  • LENGERR (22): Length error
  • CONVERSATION (24): Conversation error

Best Practices

1. Buffer Management

  • Allocate sufficient buffer space
  • Check buffer length requirements
  • Handle buffer overflow conditions
  • Use proper alignment

2. Error Handling

  • Check all response codes
  • Handle extraction failures
  • Implement retry logic
  • Log error conditions

3. Attribute Processing

  • Validate extracted attributes
  • Handle different conversation types
  • Process attributes appropriately
  • Maintain attribute consistency

Explain It Like I'm 5 Years Old

Imagine you're playing a game and want to check the settings:

Sometimes when you're playing a game, you want to see what settings are currently active. Maybe you want to check if the sound is on, what level you're playing, or how many lives you have left.

CICS GDS EXTRACT ATTRIBUTES is like pressing the "check settings" button in your game. It tells you all the current information about how the conversation is set up - what rules are being followed, how fast it's running, and what special features are turned on.

Just like you might use this information to decide how to play the game, the computer can use this information to decide how to handle the conversation or to make sure everything is working correctly.

Exercises

Exercise 1: Attribute Extraction

Write a CICS GDS EXTRACT ATTRIBUTES command to extract attributes from a conversation with ID stored in WS-CONVERSATION-ID into a 256-byte buffer.

cobol
1
2
3
4
5
6
EXEC CICS GDS EXTRACT ATTRIBUTES CONVID(WS-CONVERSATION-ID) ATTRIBUTES(WS-ATTRIBUTES) LENGTH(256) RESP(WS-RESPONSE) END-EXEC.

Exercise 2: Attribute Analysis

How would you use extracted conversation attributes to determine if a conversation is configured for high-security, high-performance communication?

Answer: Check the SECURITY attribute for high security level, SYNC_LEVEL for appropriate synchronization, BUFFER_SIZE for performance optimization, and PRIORITY for high-priority processing.

Quiz

Question 1

What is the primary purpose of CICS GDS EXTRACT ATTRIBUTES?

Answer: B) To retrieve conversation attributes

Question 2

Which parameter specifies the area to receive extracted attributes?

Answer: B) ATTRIBUTES