Re: compile+link Fujitsu Linux



On Feb 1, 6:48 am, charles.good...@xxxxxxx wrote:
Thanks for the tips.
Yes I needed to add my curent directory to LD_LIBRARY_PATH
I also nneded to add "-L./" to the cobol command to compile the main
program.
My compile commands, that work are:
cobol -dy -shared -WC,"BINARY(BYTE)" -o libMYSUB1.so MYSUB1.cbl
cobol -dy -shared -WC,"BINARY(BYTE)" -o libMYSUB2.so MYSUB2.cbl
cobol -M -dy -WC,"BINARY(BYTE),DLOAD" -o MYMAIN -L./ -lMYSUB1 -lMYSUB2
MYMAIN.cbl

I am able to compile and execute. My simple programs are designed to
allow me to see the functioning of CALL and CANCEL.....

However the results is NOT exactly what I want. Using -l does not
allow for proper functioning of the CANCEL verb (see pg 77 of user's
guide). Once a subprogram is loaded with a CALL statement, it remains
in memory regardless of CANCEL statements. The working-storage of the
sub-program is not reinitialized upon a second CALL.

Robert is completely wrong. You do not need a -l or a -L. These will
turn the CALLs into a static load and, as you say, the CANCEL will not
work as expected.

Go back to using your original compiles and links _without_ the -l or -
L.
It was only the LD_LIBRARY_PATH change that was required.

I am not sure how you determined that the CANCEL did not work but I
modified your programs to add a 2nd CALL and a CANCEL followed by a
3nd CALL in MYMAIN and then added a check for 'first time in' into
MYSUB1 and it worked as _I_ expected.

IDENTIFICATION DIVISION.
PROGRAM-ID. MYMAIN.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 ACPT PIC X.
PROCEDURE DIVISION.
OPEN-PARA.
DISPLAY "BEGIN MYMAIN".
CALL 'MYSUB1'.
CALL 'MYSUB1'.
CANCEL 'MYSUB1'.
CALL 'MYSUB1'.
DISPLAY "THE END - ACCEPTING ONE BYTE".
ACCEPT ACPT.
STOP RUN.

IDENTIFICATION DIVISION.
PROGRAM-ID. MYSUB1.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 ACPT PIC X.
01 FIRST-IN PIC X VALUE "Y".
PROCEDURE DIVISION.
OPEN-PARA.
IF FIRST-IN = "Y"
DISPLAY "First Time In"
ELSE
DISPLAY "Been here before"
END-IF
MOVE "N" TO FIRST-IN

DISPLAY "BEGIN MYSUB1 - ACCEPTING ONE BYTE".
ACCEPT ACPT.
EXIT PROGRAM.

As expected I got (ignoring your displays and accepts):

First Time In
Been here before
First Time In

So the CANCEL worked exactly as it should.

.



Relevant Pages

  • Re: Can I use a comand button to change the form properties?
    ... I have just done this myself for the first time and got it working.. ... You can create another button, "CANCEL," and have it ... "Tom K via AccessMonster.com" wrote: ... > I would like to make it harder for users to edit records, ...
    (microsoft.public.access.forms)
  • Re: Cancel Out of UserForm Return Focus
    ... Private Sub UserForm_QueryClose ... Or you could call the cancel button (or whatever button the users click on to ... I now turn off enable events at UserForm initialization ... They both work the first time. ...
    (microsoft.public.excel.programming)
  • Re: Form not closing
    ... it does display the message, but it doesn't close the form. ... 10 On Error GoTo Form_Open_Error ... 60 Exit Sub ... You need to cancel the Open event, by setting the event procedure's Cancel argument to True: ...
    (microsoft.public.access.modulesdaovba)
  • Re: closing a form with no data to display
    ... Cancel the report's No Data event, ... If you want to show the report but suppress the errors, ... to close and not display anything to the user. ... I couldn't get the DoCmd.Close command to work right. ...
    (microsoft.public.access.reports)
  • Re: Retry or Cancel
    ... after submitting a Form. ... Click Retry to send the information again, or click Cancel to return to ... does display some message but it ...
    (microsoft.public.windows.inetexplorer.ie6.browser)