Cobol cics command that seems out of context



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Cobol cics command that seems out of context

Postby nightrider43 » Mon Jul 01, 2024 6:08 pm

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
nightrider43
 
Posts: 8
Joined: Thu May 05, 2022 7:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol cics command that seems out of context

Postby prino » Tue Jul 02, 2024 2:20 pm

Comment it out, and watch it crash, or not?

How hard would it have been to think of that yourself?
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 641
Joined: Wed Mar 11, 2009 12:22 am
Location: Vilnius, Lithuania
Has thanked: 3 times
Been thanked: 29 times

Re: Cobol cics command that seems out of context

Postby nightrider43 » Thu Jul 04, 2024 7:59 pm

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.
nightrider43
 
Posts: 8
Joined: Thu May 05, 2022 7:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol cics command that seems out of context

Postby enrico-sorichetti » Thu Jul 04, 2024 9:30 pm

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 !
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Cobol cics command that seems out of context

Postby nightrider43 » Sun Jul 07, 2024 8:04 pm

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.
nightrider43
 
Posts: 8
Joined: Thu May 05, 2022 7:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol cics command that seems out of context

Postby sergeyken » Mon Jul 08, 2024 6:02 pm

This is not a DO-MY-JOB-FOR-ME forum.
Sorry for misunderstanding.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 436
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: Cobol cics command that seems out of context

Postby nightrider43 » Mon Jul 08, 2024 6:26 pm

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.
nightrider43
 
Posts: 8
Joined: Thu May 05, 2022 7:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol cics command that seems out of context

Postby enrico-sorichetti » Mon Jul 08, 2024 7:08 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Cobol cics command that seems out of context

Postby nightrider43 » Tue Jul 09, 2024 4:14 pm

ok I give up.
nightrider43
 
Posts: 8
Joined: Thu May 05, 2022 7:46 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Cobol cics command that seems out of context

Postby enrico-sorichetti » Tue Jul 09, 2024 5:32 pm

ok I give up.

Thanks &deity
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post