Page 1 of 1

Cobol cics command that seems out of context

Posted: Mon Jul 01, 2024 6:08 pm
by nightrider43
I received a cobol cics program for maintenance and found an EXEC CICS RECEIVE that seems unnecessary. The program receives a communications area via PROCEDURE USING. It executes an EXEC CICS RECEIVE command whose existence seems unnecessary to me. Just below this command it destroys the content of the variable used in INTO.
Another question:
The program is only executed through a LINK command executed by another program. So I ask what this RECEIVE command receives?

Below is the code snippet in question.

PROCEDURE DIVISION USING DFHCOMMAREA. <------------------------------ USING in te PROCEDURE DIVISION
/
*----------------------------------------------------------------*
0000-PRINCIPAL SECTION.
*----------------------------------------------------------------*
/
PERFORM 1000-INICIALIZA.
/
PERFORM 2000-PROCESSA UNTIL WS-IDY EQUAL 100 OR
WS-EIBR EQUAL 20.
/
IF WS-IDZ EQUAL 100 OR
WS-EIBR NOT EQUAL 20
PERFORM 2500-PROCESSA UNTIL
WS-EIBR EQUAL 20
END-IF.
/
PERFORM 9000-FINALIZA.
/
*--------------------*
0000-99-FIM. EXIT.
*--------------------*
*
*----------------------------------------------------------------*
1000-INICIALIZA SECTION.
*----------------------------------------------------------------*
/
EXEC CICS RECEIVE <------- command that seems to be unnecessary
INTO (W096-COMMAREA)
LENGTH (WS-LGT-COM)
NOHANDLE
END-EXEC.
/
IF EIBCALEN NOT GREATER ZEROS
MOVE ZEROS TO O-096-OPERATIONSTATUS
O-096-QTD-OCORRENCIA
MOVE 3 TO O-096-OPERATIONSTATUSMESSAGE(01:01)
MOVE WS-MSG01 TO O-096-OPERATIONSTATUSMESSAGE(02:79)
PERFORM 9999-FINALIZA
END-IF.
/
MOVE DFHCOMMAREA(01:59) TO IN-ENTRA-JAVA-096(01:59). <-------------- Here the content of W096-COMMAREA is destroyed
/
MOVE SPACE TO WS-SEL-NIS
WS-SEL-PGM
WS-SEL-DTA
WS-SEL-HRA
WS-SEL-TRM
WS-SEL-PV.
/
PERFORM 1100-VALIDA-INPUT.
PERFORM 1200-INITIALIZE-OUTPUT.
/
MOVE IN-ENTRA-JAVA-096 TO WS-ENTRA-JAVA-096-O.
/
MOVE ZEROS TO WS-RIDFLD.
/
EXEC CICS STARTBR DATASET(WS-FDSERR)
RIDFLD (WS-RIDFLD)

Cheers

Arí Ricardo
São Paulo - Brazil

Re: Cobol cics command that seems out of context

Posted: Tue Jul 02, 2024 2:20 pm
by prino
Comment it out, and watch it crash, or not?

How hard would it have been to think of that yourself?

Re: Cobol cics command that seems out of context

Posted: Thu Jul 04, 2024 7:59 pm
by nightrider43
I'm sorry, but I don't think I understood your answer because I still don't know the things I asked about in the original post.

Re: Cobol cics command that seems out of context

Posted: Thu Jul 04, 2024 9:30 pm
by enrico-sorichetti
I received a cobol cics program for maintenance and found an EXEC CICS RECEIVE that seems unnecessary.


comment the RECEIVE statement and see what happens

nobody will go thru the program logic to find out !

Re: Cobol cics command that seems out of context

Posted: Sun Jul 07, 2024 8:04 pm
by nightrider43
I had thought that someone with a good knowledge of CICS could interpret the logic and answer me.
I apologize for bothering you. I don't have the necessary debugging tools at my disposal. If I imagined that the answer would be to debug the code I wouldn't have wasted time. Sorry again.

Re: Cobol cics command that seems out of context

Posted: Mon Jul 08, 2024 6:02 pm
by sergeyken
This is not a DO-MY-JOB-FOR-ME forum.
Sorry for misunderstanding.

Re: Cobol cics command that seems out of context

Posted: Mon Jul 08, 2024 6:26 pm
by nightrider43
I don't see my statements this way, my friend. I don't have the necessary tools and asked for help from someone who might know the answer. I wanted to simplify the source program. I believe this is what the people who hire us expect from us. If it were the other way around, that is, someone asking me and I knew, I wouldn't see it as doing this person's service but rather helping them.
But, okay, I'll stop waiting for help on this issue.
I confess that I did not expect this result. I apologize again if I upset anyone.

Re: Cobol cics command that seems out of context

Posted: Mon Jul 08, 2024 7:08 pm
by enrico-sorichetti
I don't see my statements this way, my friend. I don't have the necessary tools and asked for help from someone who might know the answer.


we are not your friends ... :evil:

and you do not need any debugging tool...
just compile and test the program whithout the RECEIVE cics command
and see what happens.
you just need the basic tools any decent programmer needs to know and be proficient with

I wonder how somebody assigned a maintenance task to somebody with such low understanding of the basic programming tasks
( how to comment a cobol statement for example, recompile the program an look at what happens )


the topic is going to be locked and deleted after a while

Re: Cobol cics command that seems out of context

Posted: Tue Jul 09, 2024 4:14 pm
by nightrider43
ok I give up.

Re: Cobol cics command that seems out of context

Posted: Tue Jul 09, 2024 5:32 pm
by enrico-sorichetti
ok I give up.

Thanks &deity