Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Copybook containing SQL statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Tue Aug 25, 2009 11:55 am    Post subject: Copybook containing SQL statement
Reply with quote

I have some SQL statements in a COBOL copybook, which are expanding during my precompile. I believed till now that copybooks do not expand during precompilation. These are the precompiler options (I somewhere read that for this to happen we should have COPY as a precompile option but my precompiler did not have this). Below are the precompiler options -


APOST
APOSTSQL
ATTACH(TSO)
CCSID(37)
NOPADNTSTR
CONNECT(2)
DEC(15)
FLAG(I)
HOST(IBMCOB)
LINECOUNT(60)
MARGINS(8,72)
NEWFUN(YES)
ONEPASS
OPTIONS
PERIOD
NOSOURCE
STDSQL(NO)

Please help.
Back to top
View user's profile Send private message

dick scherrer

Site Director


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

PostPosted: Tue Aug 25, 2009 7:17 pm    Post subject:
Reply with quote

Hello,

Quote:
Below are the precompiler options
Only the ones specified. . .

Suggest you look at the output from a compile or talk with the people who support the compiler and find out what the default values are. . .

Unspecified options use site-specific defaults.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1243
Location: Israel

PostPosted: Tue Aug 25, 2009 8:04 pm    Post subject: Re: Copybook containing SQL statement
Reply with quote

niks_jude wrote:
I have some SQL statements in a COBOL copybook, which are expanding during my precompile. I believed till now that copybooks do not expand during precompilation.
Please help.

If they are expanding during your precompile, then there should be no problem... icon_question.gif

Just in case there was a misunderstanding:
If you want your copybook to be available to the precompile you have to use EXEC SQL INCLUDE copybook END-EXEC instead of COPY.

Try that and tell us if it's ok.
Back to top
View user's profile Send private message
niks_jude
Warnings : 1

Active User


Joined: 01 Dec 2006
Posts: 144
Location: Mumbai

PostPosted: Thu Aug 27, 2009 12:53 pm    Post subject:
Reply with quote

OK as for dick's question the options I have pasted are from my precompiler listing. Is there still a possibility that the COPY option is not getting displayed.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Aug 28, 2009 6:43 am    Post subject:
Reply with quote

Hello,

In the precompiler output are not all of the options shown - either as "on" or "off" (like the compiler does)? I'm not able to run a pre-compile and check my system just now.
Back to top
View user's profile Send private message
sampathkmn
Warnings : 1

New User


Joined: 12 Dec 2005
Posts: 31
Location: bangalore

PostPosted: Fri Aug 28, 2009 2:04 pm    Post subject:
Reply with quote

Hi,

Copy must have expanded because of cobol compiler which gets activated during precompilation.
All cobol statements will be expanded because of cobol compiler, and all SQLs because of precompiler.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Fri Aug 28, 2009 8:16 pm    Post subject:
Reply with quote

niks_jude,
Are you sure that you are executing DB2 precompiler and not the DB2 co-processer? DB2 co-processor is activated by 'SQL' compiler option and there is no need of precompiler step when SQL compiler option is used. Corrolary of this is - if you use the co-processor then there will be no difference in processing of COPY and INCLUDE statements. Both will be expanded at same time.

If there are SQL statements in your copybook and you have coded COPY CBOKNAME, then you need to expand such copybooks before the COMPILER step so as to get successful compilation.
For achieving this, some shops (for ex. my shop) use an ASSEMBLER program which expands the COPY statements first and then calls the DB2 precompiler so as to avoid the aforesaid problem.

Check your compiler JCL and let us know how your shop is approaching this situation.
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Aug 28, 2009 8:17 pm    Post subject:
Reply with quote

Hello,

"COPY" is not an option in my precompiler (PP 5655-S71 IBM Enterprise COBOL for z/OS 4.1.0). . .
Code:
   Partial list:
BUFSIZE(4096)               
 NOCICS                         
   CODEPAGE(1140)               
 NOCOMPILE(S)                   
 NOCURRENCY                     
   DATA(31)                     
 NODATEPROC                     
   DBCS                         

I suspect it is not in this one either. . .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us