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

The Copybook Not Getting Expanded -


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

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Wed May 19, 2010 5:01 pm
Reply with quote

HI All,

I am working on COBOL & my version controller is PANVALET.
To include the copybook we use ++INCLUDE, and this is written at the end of program.

When I use ++Include at last, In compile listing, I am not able to see the expanded form, ie the compiler is not reading this part of code, as a result not expanding. If I move this up, before any uncommented code, the compiler does not read the codes below the include(and also the include part).

Since, this is my first hands-on with include, I am not able to find the reason, I tried googling, but could not get any useful information.

Please let me know, what can be reason(W/O Code it will be difficult, But i can't paste the code due to NDA, so guyz please bear with me)

Also, When I do EXEC SQL INCLUDE COPYBOOK END-EXEC in WS Section. The compiler is expanding the copybook. But still want to know, why the same is not happening when used as ++INCLUDE.

Moderator - Please let me know, how to update the latest email Id used for notification. My old ID is disabled, so need to update the new one.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed May 19, 2010 5:10 pm
Reply with quote

Quote:
(W/O Code it will be difficult, But i can't paste the code due to NDA, so guyz please bear with me)


without us being able to see what you are doing,
you are going to have to embarrass yourself at work
and ask somebody there who has the necessary clearance to see your secret code.

instead of googleing, why don't you read the documentation at your site???

PANVELET uses the ++INCLUDE convention,
so you are doing something (painfully for you) stupid.

and
Quote:
and this is written at the end of program.

what is this garbage?

++INCLUDE is a PAN1 instruction to add from one library into the source code.

are you using SITE GENERATED AND SUPPORTED JCL to compile/link your module,
or have you created your own.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed May 19, 2010 7:34 pm
Reply with quote

Hello,

You need to talk with someone who knows your environment. . .

The ++INCLUDE statements are not to be processed by the compiler. They would be resolved before the compile begins.

Why did you choose to use ++INCLUDE for something that was a "copybook"?
Quote:
To include the copybook we use ++INCLUDE
COPY is used to expand a copybook. . .
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Wed May 19, 2010 8:01 pm
Reply with quote

Semantics.

According to the COBOL manual:

The effect of processing a COPY statement is that the library text associated with text-name is copied into the compilation unit, logically replacing the entire COPY statement, beginning with the word COPY and ending with the period, inclusive.

According to the CA-Panvalet manual:

a ++INCLUDE causes the member name specified by the ++INCLUDE to be located, and then retrieved from the CA-Panvalet library, and written to the output file in place of the ++INCLUDE.

It appears to me that both directives have the same result. The only difference is when/where the directive is processed - a Panvalet ++INCLUDE statement must be processed BEFORE the source is compiled while a COBOL COPY statement can be processed DURING compilation.

FWIW the word COPYBOOK appears nowhere in the "Enterprise COBOL for z/OS Language Reference'. It is a term that is simply used to define external elements ( to the base input source ) that contain additional source statements to be included in the current compiler input stream.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed May 19, 2010 9:56 pm
Reply with quote

Hello,

Quote:
It appears to me that both directives have the same result.
Basically, yes, but the timing may be different for different "configurations".

For example, once upon a time, the ++INCLUDE was expanded in some pre-processor step (i.e. ROSCOE, Librarian, Panvalet, etc) and COPY expanded by the actual compilation. Somewhere along the way i remember (iirc<g>) a change/feature/whatever that supported the ++INCLUDE expansion in the actual compile (for some products).

I have not stayed current with this because for more than 10 years every system i've been involved with has not used ++INCLUDE for source code icon_rolleyes.gif
Back to top
View user's profile Send private message
Ronald Burr

Active User


Joined: 22 Oct 2009
Posts: 293
Location: U.S.A.

PostPosted: Wed May 19, 2010 11:15 pm
Reply with quote

Dick,
Perhaps you are thinking of the plain vanilla INCLUDE directive, that formerly had to be processed/expanded during a DB2 Pre-Compile step but is now ( in Enterprise COBOL for z/OS ) supported in the actual compile step ( though most organizations STILL maintain a separate DB2 Pre-compile step in their compile processes ). Same is true for CICS directives - formerly required a pre-pass to expand, but are now supported in the actual compile step.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu May 20, 2010 12:13 am
Reply with quote

Hi Ronald,

Quote:
Perhaps you are thinking of the plain vanilla INCLUDE directive
I don't think so . . . This was before there was a db2 pre-compiler. . . icon_smile.gif At the time the systems i supported used products from ADR (Applied Data Research) before they were sold to CA.

I seem to recall some kind of mod for allowing the ++INCLUDE in the compile, but has been too long so the specifics have faded. . . My bad icon_redface.gif

Quote:
though most organizations STILL maintain a separate DB2 Pre-compile step in their compile processes
"That's the way we put it in and that is how it stays". . . Yup, heard this many places. Often the people who set up the compile procedures are gone and their replacements are afraid to touch anything.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Thu May 20, 2010 12:24 am
Reply with quote

Depends on content of module, but I'm sure ++include and copy xxxxxxxx need to be placed in the source exactly where the resolved expansion contents are expected.

++include at the end would be something unique and not typically a data layout.
Back to top
View user's profile Send private message
saurabh39
Warnings : 1

Active User


Joined: 11 Apr 2008
Posts: 144
Location: Jamshedpur

PostPosted: Mon May 24, 2010 2:02 pm
Reply with quote

Thanks for all the replies.


Quote:
++include at the end would be something unique and not typically a data layout


Its a data layout itself, but i guess it is site specific.

Quote:
You need to talk with someone who knows your environment. . .


Well, that is something I am not able to do. Reason, the project is new...people are new so no contact person available. Moreover, nowdays, people just like to follow what is being done. No one questioned, and if some did, they kept the knowledge to themselves. Thats why facing the issue. So, tried it here, even though i knew...the codes are site specific and odds are very high to get the correct answer. But then, whats the problem in trying. So gave it a shot.

Anyways, Thanks guyz, as of now, I have used the conventional INCLUDE and solved the problem, as of the question probably it will be in list of unanswered question...till i find some people or some document.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon May 24, 2010 7:10 pm
Reply with quote

Hello,

Always a learning experience when we "inherit" one of these. . . icon_smile.gif


Quote:
Quote:
++include at the end would be something unique and not typically a data layout


Its a data layout itself, but i guess it is site specific.
What kind of "data layout" is at the end of some cobol source? icon_confused.gif
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Tue May 25, 2010 12:36 am
Reply with quote

Probably find out that it is assembler Dsect icon_smile.gif
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 REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts Trying to change copybook in online c... CICS 4
No new posts Help to Filter File Manager Copybook ... DFSORT/ICETOOL 14
No new posts Need to add field to copybook, proble... COBOL Programming 14
No new posts Recompiling programs after a copybook... COBOL Programming 1
Search our Forums:

Back to Top