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

DB2 to be up for PRECOMPILE?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sudhanaveenkumar

New User


Joined: 29 Apr 2010
Posts: 28
Location: chennai

PostPosted: Mon Jul 05, 2010 12:46 pm
Reply with quote

could any one let me know whether DB2 subsystem has to be up for precompilation?

Can we genearate DCLGENs without db2 SUBSYSTEM?


Many Thanks
naveen
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Jul 05, 2010 12:57 pm
Reply with quote

Your DB2 doesn't have to be up for precompile. Note that you will need it for bind, however.

Since DCLGEN is a DSN subcommand, you have to supply a subsystem name in the DSN command. If you omit it, a default (usually DSN) is used.

O.
Back to top
View user's profile Send private message
sudhanaveenkumar

New User


Joined: 29 Apr 2010
Posts: 28
Location: chennai

PostPosted: Mon Jul 05, 2010 2:25 pm
Reply with quote

Thanks a lot for your reply.

Whats that DSN means?

I heard that without a DB2 subsystem on your mainframe system we can precompile a cobol db2 program.But how are they generating DCLGENs
before precompile without having DB2 subsystem.

Could any one clarify can we generate DCLGENs and precompile a cobol/db2 Pgm without having DB2 subsystem on mainframe.



Thanks
naveen
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Tue Jul 06, 2010 7:17 pm
Reply with quote

DSN is the DB2 command processor and executes as a TSO command processor. All of the DSN subcommands, except SPUFI, run under DSN in either the foreground or background.

Quote:
I heard that without a DB2 subsystem on your mainframe system we can precompile a cobol db2 program.But how are they generating DCLGENs before precompile without having DB2 subsystem
What is your source of information for this? I don't think that this can be done. If that was true, how would the SQL-statements be resolved then?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Jul 06, 2010 7:24 pm
Reply with quote

This I know for fact:
db2 pre-compile does not require db2 to be active.

Quote:
SQL-statements be resolved then?


the COBOL generated by the pre-compiler is based purely on the data and sql within the program.

now the DB2 BIND does require db2 to be active,
and during the bind process, all table references are resolved.
one of the reasons you can receive a 'good' (rc=0) precompile
yet fail in the bind step.


This is an assumption by me:
since dclgen's are based on table definitions,
which are stored in tables,
and the only access to tables is thru DB2,
I would assume that dclgen's require db2 to be active.
Back to top
View user's profile Send private message
sudhanaveenkumar

New User


Joined: 29 Apr 2010
Posts: 28
Location: chennai

PostPosted: Tue Jul 06, 2010 7:36 pm
Reply with quote

Hi All,

Many Thanks for Anuj Dhawan and Dick Brenholtz.
The source for the above said stmt is:

Plans + DBRMS + Packages + Collections + Versions = Confusion.pdf

You can find this pdf in the mainframe forum as well ibmmainframes.com/about23965.html.

The above pdf says we need not have DB2 subsystem to precompile as well as cobol/db2 pgm development(First chapter).

Now,Can anybody answer my question:
I heard that without a DB2 subsystem on your mainframe system we can precompile a cobol db2 program.But how are they generating DCLGENs before precompile without having DB2 subsystem????

Thanks
Naveen
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Tue Jul 06, 2010 7:46 pm
Reply with quote

Quote:
COBOL was the language of choice in the old days; however, companies rarely had a COBOL license on
the production machine. So, DB2 had to allow development on one box with a COBOL compiler but
without a DB2 subsystem and allow production runs on a different box with a DB2 subsystem but
without a COBOL compiler. That's how the concepts of the DB2 Precompiler and the database request
module (DBRM) were born — out of necessity.
Are you referring to the above quoted para, from page 1 of pdf?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Jul 06, 2010 7:46 pm
Reply with quote

Quote:
But how are they generating DCLGENs before precompile without having DB2 subsystem????


well, since creation/definitions of tables (as well as dclgen of copybooks) is a dba function, and it is all done around the same time,
that is before a coder starts,
the part of the development phase that does not involve a coder,
and since they can only be generated with an active db2 system,
maybe, the dba's are on another system with an active db2.

that is why the copybooks exist without an active db2 system.
Back to top
View user's profile Send private message
sudhanaveenkumar

New User


Joined: 29 Apr 2010
Posts: 28
Location: chennai

PostPosted: Tue Jul 06, 2010 7:53 pm
Reply with quote

Hi Anuj Dhawan


Yes i am referring to the para you had mentioned above.

Thanks
naveen
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Tue Jul 06, 2010 7:59 pm
Reply with quote

Ok, read the text again with emphasis added by me:
Quote:
COBOL was the language of choice in the old days; however, companies rarely had a COBOL license on
the production machine. So, DB2 had to allow development on one box with a COBOL compiler but
without a DB2 subsystem and allow production runs on a different box with a DB2 subsystem but
without a COBOL compiler. That's how the concepts of the DB2 Precompiler and the database request
module (DBRM) were born
— out of necessity.
And please read again what Dcik has said in his recent post.

So when you said:
Quote:
I heard that without a DB2 subsystem on your mainframe system ..
Precompiler did what your application needed to get it ready for execution.
Back to top
View user's profile Send private message
sudhanaveenkumar

New User


Joined: 29 Apr 2010
Posts: 28
Location: chennai

PostPosted: Tue Jul 06, 2010 10:07 pm
Reply with quote

Thanks.

I am sorry for the confusion.
My question is not answered yet.

Without DB2 subsystem,how can we generate DCLGENs for the tables used in cobol/db2 pgm.

Even my previous post says:

But how are they generating DCLGENs before precompile without having DB2 subsystem????

We need DCLGENs for precompilation and during development,precompilation there is no db2 on your system as per the stmt in confusion.pdf.Then,how can we generate DCLGENs without DB2 subsystem?


Thanks
naveen
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Jul 06, 2010 10:37 pm
Reply with quote

Quote:
Without DB2 subsystem,how can we generate DCLGENs for the tables used in cobol/db2 pgm.


you can't.!
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jul 06, 2010 10:41 pm
Reply with quote

DCLGEN is not needed at all ( a nice to have, but not needed )

if Your organization standards ask for the DCLGEN approach to be used
no reason not to run it right after the create table has been done
( the dclgen output is stored in a normal PDS )
and the person responsible for the table creation and surroundings should do it

Just a timing issue
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jul 06, 2010 10:53 pm
Reply with quote

You don't need DB2 for DCLGEN. In fact, you don't have to generate a DCLGEN, you can simply type the declarations in your favorite editor.

In my company, during conversion from ADABAS to DB2, our product generates DCLGENs based on database design only.

O.
Back to top
View user's profile Send private message
sudhanaveenkumar

New User


Joined: 29 Apr 2010
Posts: 28
Location: chennai

PostPosted: Wed Jul 07, 2010 11:50 am
Reply with quote

Many thanks for all of you for responding on my query.

I have understood from the above that we need not generate DCLGENs for cob/db2 pgm development.Straight away,code the structures in the pgm itself.


Thanks
Naveen
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Jul 07, 2010 1:18 pm
Reply with quote

sudhanaveenkumar wrote:
I have understood from the above that we need not generate DCLGENs for cob/db2 pgm development.


true

sudhanaveenkumar wrote:
I have understood from the above that we need not generate DCLGENs for cob/db2 pgm development.Straight away,code the structures in the pgm itself.


not true, no one advocated that.

create and put them into a pds/pdse used to contain copybooks.
if no include member is generated,
and instead hardcoded in a program,
means every program with sql associated with the table must have hardcoded table defs.

not a good practice and no one here would advocate such a thing.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Wed Jul 07, 2010 5:10 pm
Reply with quote

Why DCLGEN had been of so interest so far, I'm not sure. It's just declaration generation! The declarations generator (DCLGEN) produces an SQL DECLARE TABLE statement and a COBOL, PL/I, or C data declaration for a table or view named in the catalog... icon_neutral.gif
Back to top
View user's profile Send private message
sudhanaveenkumar

New User


Joined: 29 Apr 2010
Posts: 28
Location: chennai

PostPosted: Wed Jul 07, 2010 5:31 pm
Reply with quote

Many thanks all of you for replying.
Now i am clarified.

Thanks
naveen
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Wed Jul 07, 2010 7:47 pm
Reply with quote

Glad, we could help.

Good Lcuk.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Jul 07, 2010 7:58 pm
Reply with quote

yes, you are welcome
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts JCL for pl1 db2 precompile, compile a... JCL & VSAM 4
No new posts Pre-compile: Assembler - DB2 precompi... JCL & VSAM 2
No new posts DB2 precompile error when using CTE's... DB2 2
This topic is locked: you cannot edit posts or make replies. COBOL-DB2 program precompile/Bind opt... DB2 7
No new posts Precompile Problem Compuware & Other Tools 5
Search our Forums:

Back to Top