IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Doubt in addressing mode.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
passion_sujesh

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Thu Dec 30, 2010 9:29 am
Reply with quote

Hi all,

I have a question in the following scenario.

Few months ago i had coded a program (Prog A) calling a sub program (Prog B).

Prog A -- Is in Cobol 3 and compiler option -- RMODE(24).
Prog B -- Is in Cobol 2.

The program A used to run successfully becoz of the RMODE compiler option.

Now I have recompiled the called program (Prog B) to cobol 3 with compiler option AMODE(31) RMODE(ANY). The calling program is as such.

Prog A -- Is in Cobol 3 and compiler option -- RMODE(24).
Prog B -- Is in Cobol 3 and compiler option -- AMODE(31) RMODE(ANY).

My question is:
If i execute the calling program (Prog A) will it run success fully or will it abend (S0C4) becoz of the Compiler option RMODE(24).

Can you please help me.

Thanks in advance.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1049
Location: Richmond, Virginia

PostPosted: Thu Dec 30, 2010 10:01 am
Reply with quote

You have posted here 57 times, and yet you cannot just run it and find out because ... ?
Back to top
View user's profile Send private message
passion_sujesh

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Thu Jan 06, 2011 3:19 am
Reply with quote

Hi Phil,

I had run this program, it did not abend. Are there chances for this program to abend in future?

My concern is, since the sub program (in Cobol3 AMODE(31) RMODE(ANY)) is called dynamically, there are chances the program will be loaded in the memory above the 16 MB line. The main program is compiled with RMODE(24) and might not be able to access the subprogram. This might lead to S0C4 abbend. Is this scenario possible to occur in the future?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Jan 06, 2011 3:38 am
Reply with quote

31-Bit programs can always address 24-Bit as well as 31-Bit addresses, but 24-Bit programs cannot address 31-Bit addresses as the high-order register-byte will be truncated and the module will likely raise a S0C4.

Bill
Back to top
View user's profile Send private message
passion_sujesh

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Thu Jan 06, 2011 8:27 am
Reply with quote

Hi Bill,

Thanks for the reply. Can you please help me in the following doubts.

1) If i remove the Rmode(24) (also data (24) if present) from the main program, i should be able to solve the problem? or should i recompile the main program with AMODE(31) RMODE(ANY)?

2) Is there any way i can find the compiler options (Rmode, Amode options) from load module, Because there might be number of programs in production which will be affected in this simillar way.

Thanks in Advance,
Sujesh.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Thu Jan 06, 2011 8:40 am
Reply with quote

1. A COBOL program is not compiled with AMODE(31) RMODE(ANY). The COBOL compile option is DATA(24) or DATA(31).

2. What problem does your #1 point refer to in your post -- your previous posts talk about if you run the program will it abend, not any problem you're having?

3. You can find the addressing mode options from the load module -- but these are not "compiler options", they are linkage editor / binder options. ISPF 3.4 allows you to see them, or AMBLIST in batch will show you the addressing modes.

You SERIOUSLY need to review the difference between a compile and a linkage edit (binder) -- it is obvious you do not understand the difference between the two, and that lack of understanding limits what you can understand about load modules.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Thu Jan 06, 2011 8:44 am
Reply with quote

Review the COBOL "Signature" Bytes link, in the following post -

www.ibmmainframes.com/viewtopic.php?p=257256&highlight=#257256

Bill
Back to top
View user's profile Send private message
passion_sujesh

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Thu Jan 06, 2011 9:34 am
Reply with quote

Hi Robert,

Thanks for reply.

Regarding #1:

I am working on a program (Cobol 3 program with compiler option Rmode(24)) which is calling sub program (Cobol 3 program with compiler option AMODE(31) RMODE(ANY)). I tested the program it ran fine. But i had a doubt regarding the addressing mode (Rmode(24) in Main program), i was not sure if it will abend in the future. Hence i asked this question.

Can you please let me know by what are the default addressing modes in Cobol Z/os.

Thanks in advance,
Sujesh.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Thu Jan 06, 2011 5:56 pm
Reply with quote

Quote:
Can you please let me know by what are the default addressing modes in Cobol Z/os.
No -- not unless you tell of which of the many IBM compilers you are using. The current compile is Enterprise COBOL; previous compilers include Enterprise COBOL for z/OS, COBOL for OS/390 & VM, COBOL for MVS & VM, COBOL/370 , VS COBOL II, OS/VS COBOL -- not to mention Visual Age COBOL and COBOL / SAA.

Compile a program and copy the first line of data from the compiler output page into a post.
Back to top
View user's profile Send private message
passion_sujesh

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Thu Jan 06, 2011 8:59 pm
Reply with quote

Hi Robert,

Thanks for replying.

I am using 'Enterprise COBOL for z/OS'.

I more question, i am not sure if this question might sound crazy. Is it possible to find where the program is loaded, is it loaded below the 16mb line or above the line. I need to know this so that i can prove to my manager that the sub program was loaded below the 16Mb line and hence the program executed successfully (when i ran it) and to show that the program will raise a S0C4 abend if it is loaded above the line.

Thanks in advance,
Sujesh.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Thu Jan 06, 2011 9:44 pm
Reply with quote

Use ISPF 3.4 (TSO) or AMBLIST (batch) to look at the load library. ISPF 3.4 will show something like:
Code:
            Name     Prompt        Alias-of     Size      TTR     AC   AM   RM
 _________ CEEUOPT                            00000908   000513   00    31  ANY
 _________ COBMINI                            00001C88   000A0D   00    31  ANY
 _________ COBMSTUB                           00001B80   000915   00    31  ANY
AM is addressing mode, RM is residency mode for the different programs. If you see 24 in RM, the program loads below the line. See section 1.2.6 of the COBOL Programming Guide for a complete explanation of the modes and the way they can be set in COBOL.
Back to top
View user's profile Send private message
passion_sujesh

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Thu Jan 06, 2011 10:17 pm
Reply with quote

Thanks a lot Robert.

This should help me.

Thanks,
Sujesh
Back to top
View user's profile Send private message
passion_sujesh

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Thu Jan 13, 2011 5:06 am
Reply with quote

Hi Robert,

I need some information on COBOL LE. What is Cobol LE? Is it a different compiler, is it different from 'COBOL z/OS' ? Can you please help me in this.

Thanks in advance,
Sujesh.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Thu Jan 13, 2011 6:01 am
Reply with quote

LE is short for Language Environment. IBM created the Language Environment to support all compilers on z/OS -- COBOL, PL/1, and so forth. LE provides a common set of run-time services and a standard way to access system data that can be used by any LE language.

Enterprise COBOL is an LE-compliant compiler; it is not possible under current releases of z/OS to use an IBM COBOL compiler that is not LE-compliant. Earlier compilers from IBM, such as OS/VS COBOL, were not LE-compliant. z/OS COBOL and COBOL LE can be considered the same language.

IBM has a bookshelf on LE, and the Interlanguage Communication manual is in this bookshelf. Anyone wanting to call C, C++, Java, Fortran, or Assembler from COBOL (or vice versa) should bookmark the location of the bookshelf and this manual as it will be frequently referenced.
Back to top
View user's profile Send private message
passion_sujesh

New User


Joined: 14 Mar 2008
Posts: 74
Location: India,Chennai

PostPosted: Thu Jan 13, 2011 6:44 am
Reply with quote

Robert,

Thanks a lot again. I am using 'Enterprise COBOL for z/OS' hence all my program are compiled using LE-compliant compiler. Am i rite.

Thanks a lot,
Sujesh.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6248
Location: Mumbai, India

PostPosted: Thu Jan 13, 2011 2:40 pm
Reply with quote

passion_sujesh wrote:
program are compiled using LE-compliant compiler. Am i rite.
Yes, You are - though "rite" is correctly spelled as "right"..icon_smile.gif.

Robert has given an elegant explanation, so you should have answered your question your own. However, Here are some more links, you might find enjoyable:

ibmmainframes.com/about52753.html
Preparing a non-Language Environment COBOL program
Migrating to COBOL compilers under Language Environment (LE)
Language Environment COBOL component modules

Search through the posts from
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts SPOOL to Mainframe dataset in batch mode JCL & VSAM 7
No new posts HILITE on Browse mode? TSO/ISPF 2
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts Difference when accessing dataset in ... JCL & VSAM 7
Search our Forums:

Back to Top