Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DB2 queries from Program Load

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
gaurav.rajvanshi

New User


Joined: 08 Jul 2010
Posts: 23
Location: Mainframe World

PostPosted: Mon Jul 23, 2012 12:15 am    Post subject: DB2 queries from Program Load
Reply with quote

Hello All,

Can we get the SQL queries used in a COBOL-DB2 program if we just have its load module for reference.

Thank You...
Back to top
View user's profile Send private message

Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Mon Jul 23, 2012 1:33 am    Post subject:
Reply with quote

I am not sur if I understand what you mean! Do you mean eye-balling the load module to see the SQL queries in plain English. They are not even in plain English when they get to the compiler.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Mon Jul 23, 2012 2:28 am    Post subject:
Reply with quote

you can find the SQL in the DBRM library (Database Request Module library) which is:
  • populated by the db2 pre-compiler in the pre-compiler step
  • or populated by the co-processer in the compiler step - e-cobol compiles


A read of the the general db2 overview in the db2 manuals would have provided you with this information.
Back to top
View user's profile Send private message
gaurav.rajvanshi

New User


Joined: 08 Jul 2010
Posts: 23
Location: Mainframe World

PostPosted: Mon Jul 23, 2012 10:28 am    Post subject: Reply to: DB2 queries from Program Load
Reply with quote

Thanks dbZ for your reply but I wasn't able to find the same in the manuals also.

Please let me try to make my question more understandable...

A third person has provided me with a load module only (Don't know where and when he compiled his program). I want to get the queries used in the program. I just have the load module for reference which I can also use in my JCL. Do we have any ways for finding the queries by looking into the DB2 catalogs or anything else after the job completes.

Any valuable reply would be appreciated...
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1278
Location: Belgium

PostPosted: Mon Jul 23, 2012 12:19 pm    Post subject:
Reply with quote

assuming this is static SQL : if you can run the program, you also have a package and thus a stmt in SYSIBM.SYSPACKSTMT
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Jul 23, 2012 5:44 pm    Post subject:
Reply with quote

Did you consider browsing a loadlib member to see what is there?
Back to top
View user's profile Send private message
gaurav.rajvanshi

New User


Joined: 08 Jul 2010
Posts: 23
Location: Mainframe World

PostPosted: Mon Jul 23, 2012 6:07 pm    Post subject:
Reply with quote

Craq Giegerich wrote:
Did you consider browsing a loadlib member to see what is there?

Yes Craq,
a load can always give you some information like program compilation date or the other programs linked to it
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Mon Jul 23, 2012 9:39 pm    Post subject:
Reply with quote

The load module won't tell you much about the SQL text that it is processing. If you look at a compile listing you will see that all of the embedded SQL statements are commented out by the precompiler. The Cobol compiler does not store comments in the object code that it generates, so there is no way that it will end up in the load module.

As others have stated, the only place, besides the original source code, that you can find the SQL text is in the DBRMLIB member and/or SYSPACKSTMT. That's assuming that the program contains only static SQL.

If it contains dynamic SQL, you might get lucky and see some literals in the load module that give a clue as to what it is doing.
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: Mon Jul 23, 2012 11:18 pm    Post subject:
Reply with quote

Hello,

Suggest you tell the "third person" that you need the source for the SQL . . .
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 24, 2012 12:08 am    Post subject:
Reply with quote

i thought that it was odd
that someone wanted some specific sql
but did not know what the sql was.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 641
Location: Whitby, ON, Canada

PostPosted: Tue Jul 24, 2012 3:26 am    Post subject:
Reply with quote

Perhaps the TS is trying to install a module from outside his installation. That might explain the lack of source code.
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 Jul 24, 2012 7:46 am    Post subject:
Reply with quote

Quote:
A third person has provided me with a load module only (Don't know where and when he compiled his program).
Yup icon_smile.gif
Back to top
View user's profile Send private message
gaurav.rajvanshi

New User


Joined: 08 Jul 2010
Posts: 23
Location: Mainframe World

PostPosted: Tue Jul 24, 2012 10:14 am    Post subject: Reply to: DB2 queries from Program Load
Reply with quote

Thanks GuyC, Thanks Don for your valuable replies

and thanks dick/dbz for doing your best to keep the post interesting by putting in your funny comments. They really don't help...
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Tue Jul 24, 2012 11:29 am    Post subject:
Reply with quote

Your original post states
Quote:
just have its load module for reference
so the answer to your query would appear to be 'No'. If you have the DBRM then the answer would appear to be 'Yes' but you seem not to have this.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Tue Jul 24, 2012 6:13 pm    Post subject: Re: Reply to: DB2 queries from Program Load
Reply with quote

gaurav.rajvanshi wrote:
and thanks dick/dbz for doing your best to keep the post interesting by putting in your funny comments. They really don't help...

Considering the fact you just asked "How can I hack into a third person program?",
you are lucky to have received only "funny comments"... icon_exclaim.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue Jul 24, 2012 6:29 pm    Post subject: Reply to: DB2 queries from Program Load
Reply with quote

Quote:
Perhaps the TS is trying to install a module from outside his installation. That might explain the lack of source code.


the load module alone is not enough!

we are just wasting time on a poor description of the requirement and environment
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 Jul 24, 2012 8:04 pm    Post subject:
Reply with quote

Hello,

Quote:
and thanks dick/dbz for doing your best to keep the post interesting . . .
Possibly meant for me, possibly not. My comments were not intended to be "interesting". You need to have the source available for more than just seeing the DB2 queries.

As no one else has yet mentioned this yet - you should be sure you have written permission to install unknown/untested/whatever load modules on your system. Most places will not allow "neat stuff" to be installed on their systems. Even with the source, many organizations do not permit this.

I suspect you can trust whoever/whatever on your home pc, but not on your employer's or client's system.
Back to top
View user's profile Send private message
gaurav.rajvanshi

New User


Joined: 08 Jul 2010
Posts: 23
Location: Mainframe World

PostPosted: Tue Jul 24, 2012 8:16 pm    Post subject: Reply to: DB2 queries from Program Load
Reply with quote

Thank You all...
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 I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm
No new posts Need points to tune IMS Checkpoint Pr... satish.ms10 IMS DB/DC 2 Fri Sep 30, 2016 4:12 pm
No new posts ISPF program to set SCRNAME prino TSO/ISPF 5 Fri Sep 30, 2016 2:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us