Compiler option in Cobol



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

Compiler option in Cobol

Postby mf.sheela » Wed Jan 05, 2011 9:51 am

Hi,

I am new to mainframe and this forum. I had attented a interview recently and they asked me an question in cobol which i had no idea about. The question is:

1. A main program (Prog A) --> in Cobol 3 with compiler option Rmode(24). Is calling a sub program (Prog B) in Cobol 3 with the compiler options AMODE(31) RMODE(ANY). They asked me if the program will abend because of Rmode(24) option in main program. Can any one please let me know if the program will abend?

Also i am curious to know what will happen if the Main program in Cobol 3 with compiler option Rmode(24),Data(24) call a sub program in cobol 3 with compiler option AMODE(31) RMODE(ANY)? would this abbend.

Can any one please help me in this.

Thanks in advance,
Sheela.
mf.sheela
 
Posts: 2
Joined: Wed Jan 05, 2011 9:33 am
Has thanked: 0 time
Been thanked: 0 time

Re: Compiler option in Cobol

 

Re: Compiler option in Cobol

Postby steve-myers » Wed Jan 05, 2011 10:30 am

One important piece of information is lacking: is prog B called dynamically or is it statically linked with prog a?
steve-myers
Global moderator
 
Posts: 1886
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: Compiler option in Cobol

Postby mf.sheela » Wed Jan 05, 2011 6:27 pm

Hi Steve,

The sub program (Prog B) is called dynamically.


Thanks,
Sujesh.
mf.sheela
 
Posts: 2
Joined: Wed Jan 05, 2011 9:33 am
Has thanked: 0 time
Been thanked: 0 time

Re: Compiler option in Cobol

Postby FUFENG » Thu Jan 06, 2011 7:23 pm

really!i also don't know the answer.now!thank you.i get it !
FUFENG
 
Posts: 6
Joined: Wed Dec 29, 2010 12:00 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compiler option in Cobol

Postby syannigeri » Tue Feb 01, 2011 12:05 am

waiting for reply..
syannigeri
 
Posts: 21
Joined: Tue Dec 22, 2009 11:27 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compiler option in Cobol

Postby Robert Sample » Tue Feb 01, 2011 12:32 am

A main program running RMODE 24 will be passing parameters below the line. The subprogram running AMODE 31 RMODE 24 can address memory below the line, so there would not be any storage access problems. Where memory problems come from is when a main program is running AMODE 31 RMODE ANY and passes a parameter above the line to a subprogram running AMODE 24 which means it cannot access the parameters passed to it.

Terminology is critical in IT, where similar terms may mean very different things. There is no such thing as "compiler option RMODE(24)" as specified in your post -- COBOL has a DATA(24) compiler option but not RMODE(24). Only the linkage editor / binder has an RMODE option. Furthermore, you referenced "COBOL 3" in your post -- I did not answer your post because I have no idea what "COBOL 3" is nor what platform it runs on. The current IBM mainframe version of COBOL is Enterprise COBOL for z/OS; previous compilers include Enterprise COBOL for MVS & VM, COBOL for MVS & VM, COBOL/390, VS COBOL II, OS/VS COBOL There has not ever been a "COBOL 3" compiler for an IBM mainframe.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 222 times

Re: Compiler option in Cobol

Postby steve-myers » Tue Feb 01, 2011 1:15 am

A proposed RMODE for a program section can be specified in object format. In Assembler, the RMODE pseudo-operation can specify the proposed RMODE. The RMODE for a load module, if not explicitly specified by parameters or control statements in the Binder or Linkage Editor is the most restrictive of the RMODEs in the input object. Even then, a program that dynamically loads a load module can override the load module's RMODE.

As Mr. Sample indicated, an RMODE and AMODE 24 module can call an RMOOE ANY module if it makes arrangements to change the AMODE to AMODE 31 before it calls the module, and changes the AMODE back to AMODE 24 after the RMODE ANY program terminates. The big danger here is that the RMODE ANY module might attempt to return data above the 16-meg line to the RMODE/AMODE 24 program, which will cause the RMODE/AMODE 24 program to fail.

Last year a project I did had an AMODE 31 program call an RMODE 24 (actually, an RMODE unknown) program. This was done, in part, by placing any data sent to the new program in storage allocated below the 16-meg line.
steve-myers
Global moderator
 
Posts: 1886
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: Compiler option in Cobol

Postby Akatsukami » Tue Feb 01, 2011 2:56 am

Robert Sample wrote:Terminology is critical in IT, where similar terms may mean very different things. [...] Furthermore, you referenced "COBOL 3" in your post -- I did not answer your post because I have no idea what "COBOL 3" is nor what platform it runs on. The current IBM mainframe version of COBOL is Enterprise COBOL for z/OS; previous compilers include Enterprise COBOL for MVS & VM, COBOL for MVS & VM, COBOL/390, VS COBOL II, OS/VS COBOL There has not ever been a "COBOL 3" compiler for an IBM mainframe.

I believe that Enterprise COBOL for z/OS is often (mis)called COBOL 3.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1053
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post