COBOL

COBOL

COBOL

COBOL is responsible for the efficient, reliable, secure, and unseen day-to-day operations of the world's economy.

 View Only
  • 1.  SSRANGE and COBOL 6.1

    Posted Tue October 09, 2018 02:52 PM

    I am a bit puzzled by what I am seeing when I utilize this compile option because it seems to indicate there is a problem there is not.   I have this snippet of code you see below my name.  This variable  LK-RESPONSE-MSG-XML was set to the address of this pointer WS-REQMSG-XML-PTR  which is a getmained area of storage. Problem is when the string command is executed get an error IGZ0074S to the effect value in   WS-RESMSG-XML-LEN points beyond the right most character of   LK-RESPONSE-MSG-XML. My expectation is SSRANGE will flag  something that is actually a problem but in this case it appears to flagging something can only be coded one way.If SSRANGE flag things that may or may not be a problem I question the value of it.

    John J Leonard 

     

    EXEC CICS GETMAIN                     

               SET     (WS-REQMSG-XML-PTR) 

               FLENGTH (WS-RESMSG-XML-LEN) 

               INITIMG (WS-SPACES)         

     END-EXEC.                              

    SET ADDRESS OF LK-RESPONSE-MSG-XML              

                                TO WS-REQMSG-XML-PTR

     

    IF  WS-ESBHDR-FOUND                                   

          STRING  XSOP-HEADER1     DELIMITED BY SIZE      

                  WFESB-HEADER     DELIMITED BY SIZE      

                  XSOP-HEADER2     DELIMITED BY SIZE      

                  LK-RESPONSE-MSG-XML (1:WS-RESMSG-XML-LEN)

                                   DELIMITED BY SIZE      

                  XSOP-FOOTER      DELIMITED BY SIZE      

            INTO  WS-SOAP-RESPONSE-MSG                    

              ON  OVERFLOW                                

                  SET WS-OVERFLOW-YES                     

                              TO TRUE                     

          NOT ON  OVERFLOW                                

                  SET WS-OVERFLOW-NO                      

                              TO TRUE                     

          END-STRING                                      

    END-If                                                

     

    John_Leonard


  • 2.  Re: SSRANGE and COBOL 6.1

    Posted Wed October 10, 2018 03:53 PM

    What are the working-storage definitions for these fields?

    fswarbrick


  • 3.  Re: SSRANGE and COBOL 6.1

    Posted Thu October 11, 2018 02:37 PM

    This field LK-RESPONSE-MSG-XML  is defined at 6K in size The application then does a GETMAIN for 10K and there in lies the problem cause SSRANGE works off the field definitions.  The solution per Tom Ross of IBM (i.e. Captain COBOL) is to define LK-RESPONSE-MSG-XML  with a size of the largest message size you want to be able to process. Because LK-RESPONSE-MSG-XML   is defined in the linkage section there is no adverse effect on the program cause it only GETMAINS the amount of storage required. Tried it out today and it ran like a champ.

     

     

    John_Leonard


  • 4.  Re: SSRANGE and COBOL 6.1

    Posted Thu October 11, 2018 02:52 PM

    Yep, that sounds right to me.

    You didn't supply your actual definition, but you might look in to defining it as something like the following:

    01  LK-RESPONSE-MSG-XML.

        05  PIC X OCCURS UNBOUNDED DEPENDING ON WS-RESMSG-XML-LEN. 

    Just a side note, but you don't need to set a pointer and then set the address of the message from that.  You can just do this:

    EXEC CICS GETMAIN                     

               SET     (ADDRESS OF LK-RESPONSE-MSG-XML) 

               FLENGTH (WS-RESMSG-XML-LEN) 

               INITIMG (WS-SPACES)         

     END-EXEC.                              

    fswarbrick


  • 5.  Re: SSRANGE and COBOL 6.1

    Posted Thu October 11, 2018 02:58 PM

    Thanks so much for the reply. I did not write the code I inherited the code.  Never the less I think I will incorporate your suggestions

    John_Leonard