Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi everybody, I'm trying to writ

Status
Not open for further replies.

fventosa

IS-IT--Management
Oct 6, 2001
4
ES
Hi everybody,

I'm trying to write two programs in Microfocus Cobol (Windows version) to be run in OSVS batch and CICS environment. The Cobol version is Cobol II.

The first program calls dynamically a second one, which should receive 3 parameters passed by the caller.
WORKING_STORAGE SECTION.
01 data1.
01 data2
01 data3
...
PROCEDURE DIVISION.
...
CALL modulename USING data1, data2, data3.

These parameters are level 01 Working-Storage defined items in the calling program, and level 01 LINKAGE in the called one:

LINKAGE SECTION.
01 data1
01 data2
01 data3
PROCEDURE DIVISION USING data1, data2, data3.

The program call runs dynamically ok, but the called program receives the 2 first parameters.

I've been looking into the documentation for compiler directives thatdeal with that, but I've found nothing at all.

Has anybody faced such a problem? Any suggestion would be appreciated.

Thanks in advance,

Felix Ventosa
Barcelona (Spain)
 
Felix,

Try copy and paste the same sections of the program, including picture clauses (and dots) cause in this coding they are missing.

M.
BigMag, The Netherlands.
someone@euronet.nl (no kidding!)
 
The sections, data definitions and dots are all well written.

The problem is located in the Run-Time behaviour, since it seems to pass all three parameters but the called program only receives the first two.

I think there could be some kind of setup that drives this behaviour. I've found some compiler directives about it, but no one that could generate such a problem.


 
Hi,

Are you sure that your third parameter is filled in the right way?

Did you test the address of the third parameter?

Work-arounds:

If it does not work because the compiler does not support this ...... (I wonder why).... you can work around it by combining fields into one.

You can also put the adresses of the fields in a pointer table and in the called module set the fields to those adresses.

If your compiler can handle it, try EXTERNAL variables.

Regards,

Crox
 
Just for grins, put the 3 parms as sublevels of an 01 level and pass a single parm. Let us know how that works.

Did this program used to accept only 2 parms? The reason I ask, is that it might be that you are not getting your new calling program in production - and it's still sending just 2 parms.
 
forgive my ignorance, but is Microfocus cobol similar to normal mainframe in that you also need to pass a length paramter to tell the OS how long the parameters are - or can you just pass each parm as is?
 
Hi Pipk,

Microfocus COBOL behaves like mainframe COBOL. It is only less strict in the rules. It can be that your source on the pc compiles ok and on the mainframe it doesn't. For example MFC has no problem with keywords in the a-margin which belong in the b-margin.

For the rest it works ok.

The definitions in the using list of the calling program should be the same or longer than the definitions in the called program. The size of the parm is not important to COBOL and the way how it works. In fact only an address is passed, not the field - if you use the default way in the using list. There are other ways....

So you can pass the length of the fields, you can also use fields which are defined the same way....

I hope this is a little bit understandable...

Greetings,

Crox

 
Thank you for your responses. Now I'll try to answer all the suggestions:

a) I'll try to further debug the situation by getting the parm addresses as Crox suggested.
b) The program(s) accepts 2 parameters and then runs fine. It's only when I add the third one that this behaviour arises...
c) I didn't try to write the 3 parms as subfields. In fact, I expect no problemm because the first two are already Cobol structures. I'll try it anyway.

I'll let you know when this tests have been done. Thank you very much.

Felix Ventosa
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top