Progress0 of 0 lessons

CICS ACCEPT (APPC) - Accept APPC Input

CICS ACCEPT (APPC) provides APPC input acceptance capabilities for programs and transactions. It enables programs to accept APPC input, process APPC communication, and handle APPC input validation in CICS environments.

What is CICS ACCEPT (APPC)?

CICS ACCEPT (APPC) is a command that allows programs to accept input from APPC (Advanced Program-to-Program Communication) sessions in the system. It provides APPC input acceptance capabilities, APPC communication processing, and APPC input validation for CICS applications.

Command Syntax

cobol
1
2
3
4
5
6
EXEC CICS ACCEPT [FROM(data-area)] [LENGTH(data-length)] [CONVID(conversation-id)] [RESP(response-code)] END-EXEC

Parameters

Optional Parameters

  • FROM(data-area) - Data area to receive APPC input
  • LENGTH(data-length) - Length of APPC input data
  • CONVID(conversation-id) - Conversation ID for APPC session
  • RESP(response-code) - Response code variable

APPC Input Types

APPC Messages

APPC message types

  • DATA MESSAGES - APPC data messages
  • CONTROL MESSAGES - APPC control messages
  • STATUS MESSAGES - APPC status messages
  • ERROR MESSAGES - APPC error messages

APPC Sessions

APPC session types

  • BASIC SESSIONS - Basic APPC sessions
  • MAPPED SESSIONS - Mapped APPC sessions
  • CONVERSATION SESSIONS - Conversation APPC sessions
  • PARALLEL SESSIONS - Parallel APPC sessions

APPC Protocols

APPC protocol types

  • LU6.2 PROTOCOL - LU6.2 APPC protocol
  • TCP/IP PROTOCOL - TCP/IP APPC protocol
  • SNA PROTOCOL - SNA APPC protocol
  • HTTP PROTOCOL - HTTP APPC protocol

APPC Modes

APPC mode types

  • SYNC MODE - Synchronous APPC mode
  • ASYNC MODE - Asynchronous APPC mode
  • CONFIRM MODE - Confirmation APPC mode
  • FLUSH MODE - Flush APPC mode

Programming Examples

Basic APPC Input Acceptance

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. ACCEPTAPPC01. DATA DIVISION. WORKING-STORAGE SECTION. 01 APPC-DATA PIC X(80). 01 APPC-LENGTH PIC S9(4) COMP. 01 CONVERSATION-ID PIC X(8). 01 RESPONSE-CODE PIC S9(8) COMP. PROCEDURE DIVISION. DISPLAY 'Accepting APPC input from conversation' DISPLAY 'Conversation ID: ' CONVERSATION-ID EXEC CICS ACCEPT FROM(APPC-DATA) LENGTH(APPC-LENGTH) CONVID(CONVERSATION-ID) RESP(RESPONSE-CODE) END-EXEC IF RESPONSE-CODE = DFHRESP(NORMAL) DISPLAY 'APPC input accepted successfully' DISPLAY 'APPC data: ' APPC-DATA DISPLAY 'APPC length: ' APPC-LENGTH ELSE DISPLAY 'APPC input acceptance failed' END-IF EXEC CICS RETURN END-EXEC.

Advanced APPC Input 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. ACCEPTAPPC02. DATA DIVISION. WORKING-STORAGE SECTION. 01 APPC-DATA PIC X(80). 01 APPC-LENGTH PIC S9(4) COMP. 01 CONVERSATION-ID PIC X(8). 01 RESPONSE-CODE PIC S9(8) COMP. 01 APPC-COUNT PIC S9(2) COMP VALUE 0. 01 MAX-APPC PIC S9(2) COMP VALUE 3. 01 APPC-STATUS PIC X(1). 01 APPC-LIST. 05 APPC-ITEM OCCURS 3 TIMES. 10 APPC-ID PIC X(8). 10 APPC-DATA PIC X(80). 10 APPC-LENGTH PIC S9(4) COMP. 10 APPC-STATUS PIC X(1). PROCEDURE DIVISION. PERFORM INITIALIZE-APPC-SESSIONS PERFORM ACCEPT-MULTIPLE-APPC-INPUTS EXEC CICS RETURN END-EXEC. INITIALIZE-APPC-SESSIONS. MOVE 'APPC001' TO APPC-ID(1) MOVE 'APPC002' TO APPC-ID(2) MOVE 'APPC003' TO APPC-ID(3). ACCEPT-MULTIPLE-APPC-INPUTS. PERFORM VARYING APPC-COUNT FROM 1 BY 1 UNTIL APPC-COUNT > MAX-APPC MOVE APPC-ID(APPC-COUNT) TO CONVERSATION-ID PERFORM ACCEPT-SINGLE-APPC-INPUT IF RESPONSE-CODE = DFHRESP(NORMAL) MOVE APPC-DATA TO APPC-DATA(APPC-COUNT) MOVE APPC-LENGTH TO APPC-LENGTH(APPC-COUNT) MOVE 'A' TO APPC-STATUS(APPC-COUNT) DISPLAY 'APPC input ' APPC-COUNT ' accepted successfully' ELSE MOVE 'F' TO APPC-STATUS(APPC-COUNT) DISPLAY 'APPC input ' APPC-COUNT ' acceptance failed' END-IF END-PERFORM. ACCEPT-SINGLE-APPC-INPUT. EXEC CICS ACCEPT FROM(APPC-DATA) LENGTH(APPC-LENGTH) CONVID(CONVERSATION-ID) RESP(RESPONSE-CODE) END-EXEC.

Error Handling with APPC Input Acceptance

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
IDENTIFICATION DIVISION. PROGRAM-ID. ACCEPTAPPC03. DATA DIVISION. WORKING-STORAGE SECTION. 01 APPC-DATA PIC X(80). 01 APPC-LENGTH PIC S9(4) COMP. 01 CONVERSATION-ID PIC X(8). 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 APPC-ACCEPT-SUCCESSFUL PIC X(1) VALUE 'N'. PROCEDURE DIVISION. PERFORM ACCEPT-APPC-INPUT-WITH-RETRY EXEC CICS RETURN END-EXEC. ACCEPT-APPC-INPUT-WITH-RETRY. PERFORM ACCEPT-APPC-INPUT IF RESPONSE-CODE NOT = DFHRESP(NORMAL) AND RETRY-COUNT < MAX-RETRIES ADD 1 TO RETRY-COUNT DISPLAY 'Retry ' RETRY-COUNT ' APPC input acceptance operation' PERFORM ACCEPT-APPC-INPUT-WITH-RETRY END-IF. ACCEPT-APPC-INPUT. EXEC CICS ACCEPT FROM(APPC-DATA) LENGTH(APPC-LENGTH) CONVID(CONVERSATION-ID) RESP(RESPONSE-CODE) END-EXEC EVALUATE RESPONSE-CODE WHEN DFHRESP(NORMAL) MOVE 'Y' TO APPC-ACCEPT-SUCCESSFUL DISPLAY 'APPC input acceptance operation successful' WHEN DFHRESP(NOTAUTH) DISPLAY 'Not authorized to accept APPC input' WHEN DFHRESP(INVREQ) DISPLAY 'Invalid APPC input acceptance request' WHEN DFHRESP(APPCERR) DISPLAY 'APPC input acceptance error' WHEN DFHRESP(APPCNOTFOUND) DISPLAY 'APPC conversation not found' WHEN DFHRESP(APPCINUSE) DISPLAY 'APPC conversation is in use' WHEN OTHER DISPLAY 'Unexpected APPC input acceptance error' END-EVALUATE.

APPC Communication Management

APPC Session Management

  • Session Allocation - Allocate APPC sessions
  • Session Deallocation - Deallocate APPC sessions
  • Session Monitoring - Monitor APPC sessions
  • Session Validation - Validate APPC sessions

APPC Message Processing

  • Message Parsing - Parse APPC messages
  • Message Validation - Validate APPC messages
  • Message Transformation - Transform APPC messages
  • Message Routing - Route APPC messages

APPC Error Handling

  • Error Detection - Detect APPC errors
  • Error Recovery - Recover from APPC errors
  • Error Logging - Log APPC errors
  • Error Reporting - Report APPC errors

APPC Performance

  • Performance Monitoring - Monitor APPC performance
  • Performance Optimization - Optimize APPC performance
  • Performance Tuning - Tune APPC performance
  • Performance Analysis - Analyze APPC performance

Error Handling

Common Response Codes

  • DFHRESP(NORMAL) - APPC input acceptance operation successful
  • DFHRESP(NOTAUTH) - Not authorized to accept APPC input
  • DFHRESP(INVREQ) - Invalid APPC input acceptance request
  • DFHRESP(APPCERR) - APPC input acceptance error
  • DFHRESP(APPCNOTFOUND) - APPC conversation not found
  • DFHRESP(APPCINUSE) - APPC conversation is in use

Performance Considerations

APPC Efficiency

  • Optimize APPC operations - Use efficient APPC handling
  • Minimize APPC overhead - Reduce APPC processing overhead
  • Use APPC pooling - Implement APPC pooling
  • Monitor APPC frequency - Track APPC input acceptance patterns

System Impact

  • Monitor system impact - Track how APPC input acceptance affects the system
  • Optimize APPC handling - Ensure efficient APPC processing
  • Manage APPC usage - Monitor APPC consumption
  • Track performance metrics - Monitor APPC handling performance

Best Practices

APPC Input Acceptance Best Practices

  • • Accept APPC input only when APPC input is needed
  • • Implement proper error handling for APPC operations
  • • Validate APPC conversation state before accepting input
  • • Use appropriate APPC management techniques
  • • Monitor APPC input acceptance activities and performance
  • • Maintain APPC input acceptance audit trails
  • • Handle APPC input acceptance errors gracefully

Explain It Like I'm 5 Years Old

Think of CICS ACCEPT (APPC) like receiving a phone call:

  • Phone Rings: "The phone is ringing" - APPC input available
  • Answer Phone: "Answer the phone" - Accept APPC input
  • Listen to Caller: "Listen to what the caller says" - Process APPC input
  • Respond to Caller: "Respond to the caller" - Process APPC input
  • Hang Up: "Hang up the phone" - Complete APPC input

Exercises

Exercise 1: Basic APPC Input Acceptance

Create a program that accepts basic APPC input from conversations.

Exercise 2: Advanced APPC Input Processing

Write a program that processes multiple APPC input acceptances.

Exercise 3: Error Handling

Implement comprehensive error handling for APPC input acceptance failures.