why CICS COMMAND "RECEIVE" no Normal return?



Support for CICS/ESA, CICS/TS & Transaction Gateway, CICS Configuration Manager and CICS Performance Analyzer

why CICS COMMAND "RECEIVE" no Normal return?

Postby helen2000 » Fri Aug 06, 2010 7:03 pm

Hi All,
for the following code, when I input "mpi0 abc", the program always perform show-cics-error instead of display "hello, world",
in other words, cics COMMAND "RECEIVE" didn't return Normal(0). I trace the code, I found RESP-CODE is
always 6 instead of 0, why? how to figure out? thanks,

 000017        01  RESP-CODE PIC S9(8) COMP.             
 000018        01  RCV-BUF PIC X(80).                   
 000019        01  RCV-LEN PIC S9(4) COMP VALUE 10.     
 000020        01  WK-INFO PIC X(40).                   
 000021       /----------------*                         




 000032                     EXEC CICS RECEIVE INTO (RCV-BUF)           
 000033                                     LENGTH (RCV-LEN)           
 000034                                     MAXLENGTH (80)             
 000035                                     RESP(RESP-CODE)             
 000036                     END-EXEC.                                   
 000037                     IF RESP-CODE NOT = DFHRESP(NORMAL)         
 000038                         PERFORM SHOW-CICS-ERROR                 
 000039                         EXEC  CICS  RETURN                     
 000040                         END-EXEC                               
 000041                     END-IF.                                     
 000042                     MOVE 'HELLO, WORLD' TO WK-INFO.             
 000043                     EXEC CICS SEND FROM (WK-INFO)               
 000044                                         LENGTH (12)             
 000045                                         ERASE                   
 000046                                         RESP (RESP-CODE)       
 000047                     END-EXEC.   
helen2000
 
Posts: 85
Joined: Sat Aug 08, 2009 9:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: why CICS COMMAND "RECEIVE" no Normal return?

Postby Robert Sample » Fri Aug 06, 2010 7:13 pm

Your code needs to be modified to handle the EOC. From the CICS Programming Guide:
4.3.7.1 Chaining input data

As noted earlier, some SNA devices segment long input messages for transmission. Each individual segment is called a request unit (RU), and the entire logical message is called a chain. CICS provides an option in the terminal definition, BUILDCHAIN, that governs who assembles the chain. If the BUILDCHAIN value for the terminal is YES, CICS assembles the chain and presents the entire message to the program in response to a single RECEIVE command. This choice ensures that the whole chain is complete and available before it is presented to the application.

If BUILDCHAIN=NO, the application assembles the chain. CICS provides one RU for each RECEIVE. The application can tell when it has received the last RU in the chain, because CICS raises the EOC (end-of-chain) condition at that time. CICS raises this condition even when there is only one RU in the chain, or when it assembles the chain, or when the input is from a terminal that does not support inbound chaining, like a 3270 display. An EOC condition is not considered an error; the CICS default action when it occurs is to ignore the condition.
So EOC (response code 6) is normal and should not be treated as an error.
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: why CICS COMMAND "RECEIVE" no Normal return?

Postby helen2000 » Fri Aug 06, 2010 7:36 pm

thank you, Mr. Robert,

I change the code as following, it works very well, thanks, again, Helen

.....
IF RESP-CODE NOT = DFHRESP(NORMAL)  and RESP-CODE NOT = 6       
000038                         PERFORM SHOW-CICS-ERROR                 
000039                         EXEC  CICS  RETURN                     
000040                         END-EXEC                               
000041                     END-IF.           
................
helen2000
 
Posts: 85
Joined: Sat Aug 08, 2009 9:44 pm
Has thanked: 0 time
Been thanked: 0 time

Re: why CICS COMMAND "RECEIVE" no Normal return?

Postby Robert Sample » Fri Aug 06, 2010 7:57 pm

Why not
IF  RESP-CODE NOT = DFHRESP(NORMAL) 
AND RESP-CODE NOT = DFHRESP(EOC)
    PERFORM SHOW-CICS-ERROR                 
    EXEC  CICS  RETURN                     
    END-EXEC                               
END-IF. 
to remove the spurious constant from the code?
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: why CICS COMMAND "RECEIVE" no Normal return?

Postby helen2000 » Fri Aug 06, 2010 9:04 pm

thank you so much! Robert, :D
helen2000
 
Posts: 85
Joined: Sat Aug 08, 2009 9:44 pm
Has thanked: 0 time
Been thanked: 0 time


Return to CICS

 


  • Related topics
    Replies
    Views
    Last post