Hi,
Let me start with the shortest COBOL program.
IDENTIFICATION DIVISION.
PROGRAM-ID. SHORTEST.
PROCEDURE DIVISION.
DISPLAY "THE SHORTEST COBOL PROGRAM IS OF 5 LINES".
STOP RUN.
We get the Object Module which contains the machine instructions when we compile the above 5 lines of source code.
My question is:
What is specific use of Link Edit in this case? The Link Editor in general resolves all the external references and transforms the Object Module in an executable Load Module form. What are the crucial differences between the Object Module and the Load Module of the above 5 lines of code? Please, let me know your opinion. I know that even the above Object Module cannot be directly run without beinf LinkEdited. But, I am not aware of the technical reason.
Please, help me. Thanking you a lot in anticipation.
With high regards,
Shamik Banerjee
Difference between an Object Module and Load Module
Moderators: dbzTHEdinosauer, Moderator Group
Difference between an Object Module and Load Module
Thanks & Regards,
Shamik Banerjee
Shamik Banerjee
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
actually, you can remove the display instruction, and have a cobol prg with only 4 lines.
and join the 20th century of computing. stop using STOP RUN and start using GOBACK.
suggest you start by reading the following Redbooks z/os systems programming
it would be better for both of you to extend your knowledge by reading the documentation that exists,
than having any of us providing paraphrased (from what is already well written)
answers to 'select topics'.
The answer to this question, and probably many more that you have,
(possibly don't realize that you have)
is contained in the above publications in an easy to read manner.
Using the Redbook library allows you to 'evade'
the hard to read and sometimes obscurely organized Technical Manuals normally produced by IBM
and learn about the system that you are (or should be) becoming proficient.
and join the 20th century of computing. stop using STOP RUN and start using GOBACK.
suggest you start by reading the following Redbooks z/os systems programming
it would be better for both of you to extend your knowledge by reading the documentation that exists,
than having any of us providing paraphrased (from what is already well written)
answers to 'select topics'.
The answer to this question, and probably many more that you have,
(possibly don't realize that you have)
is contained in the above publications in an easy to read manner.
Using the Redbook library allows you to 'evade'
the hard to read and sometimes obscurely organized Technical Manuals normally produced by IBM
and learn about the system that you are (or should be) becoming proficient.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
To answer Chandana's query: "The verb DISPLAY in COBOL generates a lot of code in mainframe Assembler. Included in it is a call to output your message. The link edit program pulls together the common routines necessary to actually define the location (SYSOUT by default on many systems), the methods used to actually output something and then to output it.
Go ahead and compile this and save both the object file and the results of the link edit. If you can read hex and know your way around a load module well enough, you'll see the routines added to the object file to support the DISPLAY. You can't run the object file because it doesn't have the other routines necessary to support the calls for service. That is what is in the link book."
Cheers,
Shamik Banerjee
Go ahead and compile this and save both the object file and the results of the link edit. If you can read hex and know your way around a load module well enough, you'll see the routines added to the object file to support the DISPLAY. You can't run the object file because it doesn't have the other routines necessary to support the calls for service. That is what is in the link book."
Cheers,
Shamik Banerjee
Thanks & Regards,
Shamik Banerjee
Shamik Banerjee
- dbzTHEdinosauer
- Moderator
- Posts: 981
- Joined: Mon Oct 02, 2006 8:31 pm
Shamik123,Shamik123 wrote:The link edit program pulls together the common routines necessary to actually define the location (SYSOUT by default on many systems)
I suggested to you that you do some reading.
as you have decided to just pontificate on things you only know a little,
I am going to correct the above quote.
the actually definition of the output is accomplished in other SECTIONs of the COBOL program.
The default output is defined by the COBOL Program and not the OS.
the actual location is accomplished via ALLOCATE either (normally) thru DD Statements in your JCL or by dynamic allocation by a CALL from within the COBOL Program.
//SYSOUT DD SYSOUT=* << will drive to the sysout dsid in the spool.
//SYSOUT DD DSN=hlq.mlq.llq,DCB=(parms)
as you can see, your sysout can be directly written to a dataset.
so, the linkeditor (or binder) binds/completes CALLs to system output routines which will accomplish the actual i/o.
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page