Progress0 of 0 lessons

CICS ISSUE SEND - Send Message Control

CICS ISSUE SEND provides message sending capabilities for programs and transactions. It enables programs to send messages, manage message transmission, and handle message sending in CICS environments.

What is CICS ISSUE SEND?

CICS ISSUE SEND is a command that allows programs to send messages to users, terminals, or other systems. It provides message transmission capabilities, communication management, and message handling for CICS applications.

Command Syntax

cobol
1
2
3
4
5
6
EXEC CICS ISSUE SEND [FROM(data-area)] [LENGTH(data-length)] [TERMINAL(terminal-id)] [RESP(response-code)] END-EXEC

Parameters

Optional Parameters

  • FROM(data-area) - Data area containing message to send
  • LENGTH(data-length) - Length of message data
  • TERMINAL(terminal-id) - Terminal ID to send message to
  • RESP(response-code) - Response code variable

Send Types

Terminal Send

Sending messages to terminals

  • TERMINAL MESSAGE - Send message to specific terminal
  • USER MESSAGE - Send message to user terminal
  • DISPLAY MESSAGE - Display message on terminal
  • NOTIFICATION MESSAGE - Send notification to terminal

System Send

Sending messages to systems

  • SYSTEM MESSAGE - Send message to system
  • INTER-SYSTEM MESSAGE - Send message between systems
  • NETWORK MESSAGE - Send message over network
  • REMOTE MESSAGE - Send message to remote system

Data Send

Sending data messages

  • DATA MESSAGE - Send data message
  • FILE MESSAGE - Send file data message
  • RECORD MESSAGE - Send record data message
  • BATCH MESSAGE - Send batch data message

Control Send

Sending control messages

  • CONTROL MESSAGE - Send control message
  • COMMAND MESSAGE - Send command message
  • STATUS MESSAGE - Send status message
  • RESPONSE MESSAGE - Send response message

Programming Examples

Basic Message Send

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
IDENTIFICATION DIVISION. PROGRAM-ID. SEND01. DATA DIVISION. WORKING-STORAGE SECTION. 01 MESSAGE-DATA PIC X(50) VALUE 'Hello from CICS program'. 01 MESSAGE-LENGTH PIC S9(8) COMP VALUE 50. 01 TERMINAL-ID PIC X(4) VALUE 'TERM'. 01 RESPONSE-CODE PIC S9(8) COMP. PROCEDURE DIVISION. DISPLAY 'Sending message to terminal...' EXEC CICS ISSUE SEND FROM(MESSAGE-DATA) LENGTH(MESSAGE-LENGTH) TERMINAL(TERMINAL-ID) RESP(RESPONSE-CODE) END-EXEC IF RESPONSE-CODE = DFHRESP(NORMAL) DISPLAY 'Message sent successfully' DISPLAY 'Message: ' MESSAGE-DATA(1:MESSAGE-LENGTH) DISPLAY 'Terminal: ' TERMINAL-ID ELSE DISPLAY 'Failed to send message' END-IF EXEC CICS RETURN END-EXEC.

Advanced Message Send

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
IDENTIFICATION DIVISION. PROGRAM-ID. SEND02. DATA DIVISION. WORKING-STORAGE SECTION. 01 MESSAGE-DATA PIC X(100). 01 MESSAGE-LENGTH PIC S9(8) COMP. 01 TERMINAL-ID PIC X(4) VALUE 'TERM'. 01 RESPONSE-CODE PIC S9(8) COMP. 01 MESSAGE-TYPE PIC X(1). 01 USER-ID PIC X(8) VALUE 'USER001'. PROCEDURE DIVISION. PERFORM DETERMINE-MESSAGE-TYPE PERFORM SEND-MESSAGE EXEC CICS RETURN END-EXEC. DETERMINE-MESSAGE-TYPE. *> Add logic to determine message type MOVE 'N' TO MESSAGE-TYPE. SEND-MESSAGE. EVALUATE MESSAGE-TYPE WHEN 'N' MOVE 'Notification message for user' TO MESSAGE-DATA MOVE 32 TO MESSAGE-LENGTH WHEN 'E' MOVE 'Error message: Operation failed' TO MESSAGE-DATA MOVE 33 TO MESSAGE-LENGTH WHEN 'S' MOVE 'Status message: Operation completed' TO MESSAGE-DATA MOVE 36 TO MESSAGE-LENGTH WHEN 'D' MOVE 'Data message: Processing results' TO MESSAGE-DATA MOVE 35 TO MESSAGE-LENGTH WHEN OTHER MOVE 'General message from system' TO MESSAGE-DATA MOVE 28 TO MESSAGE-LENGTH END-EVALUATE EXEC CICS ISSUE SEND FROM(MESSAGE-DATA) LENGTH(MESSAGE-LENGTH) TERMINAL(TERMINAL-ID) RESP(RESPONSE-CODE) END-EXEC IF RESPONSE-CODE = DFHRESP(NORMAL) DISPLAY 'Message sent to user: ' USER-ID DISPLAY 'Message: ' MESSAGE-DATA(1:MESSAGE-LENGTH) ELSE DISPLAY 'Failed to send message' END-IF.

Error Handling with Message Send

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
IDENTIFICATION DIVISION. PROGRAM-ID. SEND03. DATA DIVISION. WORKING-STORAGE SECTION. 01 MESSAGE-DATA PIC X(50) VALUE 'Test message from CICS'. 01 MESSAGE-LENGTH PIC S9(8) COMP VALUE 50. 01 TERMINAL-ID PIC X(4) VALUE 'TERM'. 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. PROCEDURE DIVISION. PERFORM SEND-MESSAGE-WITH-RETRY EXEC CICS RETURN END-EXEC. SEND-MESSAGE-WITH-RETRY. PERFORM SEND-MESSAGE IF RESPONSE-CODE NOT = DFHRESP(NORMAL) AND RETRY-COUNT < MAX-RETRIES ADD 1 TO RETRY-COUNT DISPLAY 'Retry ' RETRY-COUNT ' sending message' PERFORM SEND-MESSAGE-WITH-RETRY END-IF. SEND-MESSAGE. EXEC CICS ISSUE SEND FROM(MESSAGE-DATA) LENGTH(MESSAGE-LENGTH) TERMINAL(TERMINAL-ID) RESP(RESPONSE-CODE) END-EXEC EVALUATE RESPONSE-CODE WHEN DFHRESP(NORMAL) DISPLAY 'Message sent successfully' WHEN DFHRESP(INVREQ) DISPLAY 'Invalid send request' WHEN DFHRESP(LENGERR) DISPLAY 'Message length error' WHEN DFHRESP(TERMIDERR) DISPLAY 'Terminal ID error' WHEN DFHRESP(COMMERR) DISPLAY 'Communication error occurred' WHEN OTHER DISPLAY 'Unexpected error occurred' END-EVALUATE.

Message Management

Message Control

  • Message Creation - Create message content
  • Message Formatting - Format message data
  • Message Validation - Validate message content
  • Message Transmission - Transmit messages

Communication Management

  • Terminal Communication - Communicate with terminals
  • System Communication - Communicate with systems
  • Network Communication - Communicate over network
  • Message Routing - Route messages appropriately

Delivery Management

  • Delivery Confirmation - Confirm message delivery
  • Delivery Tracking - Track message delivery
  • Delivery Monitoring - Monitor delivery status
  • Delivery Recovery - Recover from delivery failures

Error Recovery

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

Error Handling

Common Response Codes

  • DFHRESP(NORMAL) - Message sent successfully
  • DFHRESP(INVREQ) - Invalid send request
  • DFHRESP(LENGERR) - Message length error
  • DFHRESP(TERMIDERR) - Terminal ID error
  • DFHRESP(COMMERR) - Communication error
  • DFHRESP(NOTAUTH) - Not authorized to send

Performance Considerations

Send Efficiency

  • Optimize message content - Use efficient message formats
  • Minimize send overhead - Reduce send processing overhead
  • Use appropriate send types - Choose appropriate send methods
  • Monitor send frequency - Track send occurrence patterns

System Impact

  • Monitor system impact - Track how sends affect the system
  • Optimize send handling - Ensure efficient send processing
  • Manage resource usage - Monitor resource consumption
  • Track performance metrics - Monitor send handling performance

Best Practices

Message Send Best Practices

  • • Use clear and concise message content
  • • Provide meaningful message information
  • • Implement proper send handling
  • • Ensure message delivery confirmation
  • • Monitor send success rates
  • • Use appropriate send timing
  • • Maintain send message audit trails

Explain It Like I'm 5 Years Old

Think of CICS ISSUE SEND like sending a letter:

  • Write Letter: "Write your message on paper" - Create message
  • Put in Envelope: "Put the letter in an envelope" - Format message
  • Write Address: "Write the address on the envelope" - Specify terminal
  • Send Letter: "Put the letter in the mailbox" - Send message
  • Letter Delivered: "The letter gets delivered" - Message received

Exercises

Exercise 1: Basic Message Send

Create a program that sends a basic message to a terminal.

Exercise 2: Conditional Message Send

Write a program that sends different messages based on conditions.

Exercise 3: Error Handling

Implement comprehensive error handling for message send failures.