1828665 Members
1457 Online
109984 Solutions
New Discussion

Re: COBOL signal handler

 
Ignacio Javier
Regular Advisor

Attempt to access item beyond bounds of memory



Hi everybody:

I am trying to call from a cobol program the rutine signal to define a user signal to execute a procedure.
The program is simple but i do not know why is not working.

here it is:


DATA DIVISION.
WORKING-STORAGE SECTION.
01 punt-procedure usage procedure-pointer

PROCEDURE DIVISION.
set punt-procedure to entry 'recibe-senial'
call "signal" using by value 19, by value punt-procedure

display "El valor de punt-procedure es" punt-procedure
display "La llamada a senial es " return-code

perform until 1=2
display "Dentro del bucle......."
call "sleep" using by value 3
end-perform
stop run.

I compile the program with:

cob -xctvg -N hplineno prueba_signal.cbl

Could you please help me ?

Thanks in advance
3 REPLIES 3
Ignacio Javier
Regular Advisor

Re: Attempt to access item beyond bounds of memory


Sorry,

i did not include in the post, the code of the entry point:

entry "recibe-senial".
display "the signal has been caught"
exit program
.
Steven E. Protter
Exalted Contributor

Re: Attempt to access item beyond bounds of memory

Shalom,

I think this is what shared memory is for.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dennis Handly
Acclaimed Contributor

Re: COBOL signal handler

Your subject doesn't agree with your question.
It seems you are trying to create a signal handler in COBOL for SIGPWR. (I don't think you can catch such a signal.)

The last COBOL I worked on was for the 1985 Standard. It didn't have your usage procedure-pointer.

In any case, I would NOT use ENTRY but I would create another program. And if you don't want to return, add a STOP RUN at the bottom.

>SEP: I think this is what shared memory is for.

I'm not sure I get the connection between shared memory and signals and the mismatched subject? Did you mean swap space?