How a copybook is expanded using COBOL compiler



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

How a copybook is expanded using COBOL compiler

Postby smithabg » Mon Aug 04, 2008 11:32 am

Hello,

I have been compiling COBOL program in OS390 with by invoking the program "IGYCRCTL". I want to know how this works. The area of particular interest is how it expands the copybooks included in the COBOL programs (COPY statements). In the compiler listing, we can see the expanded copybooks. How the compiler does this? Can you please provide me with the details.

Thanks,
Smitha
smithabg
 
Posts: 3
Joined: Mon Aug 04, 2008 11:22 am
Has thanked: 0 time
Been thanked: 0 time

Re: How a copybook is expanded using COBOL compiler

Postby dick scherrer » Mon Aug 04, 2008 11:54 am

Hello Smitha and welceom to the forums,

One of the datasets known to the compile process is known as the "copy lib".

When you specify COPY SOMENAME in cobol code, the content of the SOMENAME member of the copy lib is copied nto the source code at that point.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How a copybook is expanded using COBOL compiler

Postby smithabg » Tue Aug 05, 2008 11:14 am

Hello Dick,

Thank you for the reply.
Will there be some subroutine or so to copy the content of "SOMENAME" to the source code? If so, can you please provide that.
Else, can I have the code of the compiler which does this part of the compile procedure.
In which language is this part written for the compiler? Can you please help in this regard?

Thanks,
Smitha
smithabg
 
Posts: 3
Joined: Mon Aug 04, 2008 11:22 am
Has thanked: 0 time
Been thanked: 0 time

Re: How a copybook is expanded using COBOL compiler

Postby dick scherrer » Tue Aug 05, 2008 9:49 pm

Hello,

Will there be some subroutine or so to copy the content of "SOMENAME" to the source code? If so, can you please provide that.
This is an internal part of the compiler. It is not something you can "work with".

Else, can I have the code of the compiler which does this part of the compile procedure.
In which language is this part written for the compiler? Can you please help in this regard?
Why do you want compiler code? I suspect you are looking for "something" but have not yet clarified what you are looking for. Last i actually looked, the compiler was written in assembler. That was long, long ago. I've heard that there are now pieces written in C and PL/I.

If you explain just what you are trying to find/learn, we may have better suggestions.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How a copybook is expanded using COBOL compiler

Postby smithabg » Thu Aug 07, 2008 3:27 pm

Hello,

My problem is:
I have an Assembler program (which is part of a tool) which expands the copy statements in a COBOL program. But the current problem with this Assembler program is that it cannot handle nested COPY statements i.e. COPY statement within a copybook is handled incorrectly. We are looking for a solution for this.
The compiler handles this part correctly. So, I am looking for the compiler code.
If I get this code in Assembler, it'll be of great help.
Can you help me in this regard?

Thanks,
Smitha.
smithabg
 
Posts: 3
Joined: Mon Aug 04, 2008 11:22 am
Has thanked: 0 time
Been thanked: 0 time

Re: How a copybook is expanded using COBOL compiler

Postby dick scherrer » Fri Aug 08, 2008 2:40 am

Hello,

Can you help me in this regard?
No longer. . . Once upon a time IBM made things like the compiler and operating system components code available on tape/microfiche. I have seen nothing like it for many years.

Depending on how you've approached the task, you are basically looking at a "bill of materials" process (bomp) or "parts explosion" routine that recursively nests down and then steps back up as each lower layer is resolved.

If you explain what your current code does and what is not happening correctly (or abending), someone may have suggestions.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post