View previous topic :: View next topic |
Author |
Message |
issac1029 Intermediate

Joined: 10 Dec 2005 Posts: 159 Topics: 75
|
Posted: Mon Mar 20, 2006 9:08 am Post subject: -927 question about dsneli |
|
|
Hi all,
I've see so many post about this problem,but their answer have not describe clearly,more things I want to know is that:
assume there is a calling pgm A and a called pgm B(a pgm with sql)
all call db2 interface are static,It was said in other post that if A call B,then A must compile by adding in link-edit step.
1.But in a static call to db2 ,would not the final module intergrate the object DSNHLI in module B?and when I compile A,,Ionly need to find the lib(include B lod),so why I must write in link-edit of A'compile?
2.If only A have db2 code,B do not have,does A still have to resolve link-edit by writing in sysin? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Mar 20, 2006 9:12 am Post subject: |
|
|
issac1029,
It depends on the language in which the program is coded. The language interface modules required in each environment are as follows:
Code: |
o IMS : DFSLI000
o CICS : DSNCLI
o CAF : DSNALI
o TSO : DSNELI
o COBOL : DSNELI
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
issac1029 Intermediate

Joined: 10 Dec 2005 Posts: 159 Topics: 75
|
Posted: Mon Mar 20, 2006 9:32 am Post subject: |
|
|
kolusu,
Thanks for you quick reply,
it assume the enviroment is cobol,I'm not concern about which link card I should use.Actual I want to know is whether DSNELI'adding are result from the db2 code in calling pgm or the called pgm. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Mar 20, 2006 9:44 am Post subject: |
|
|
issac1029,
It does not matter if your main program or sub program is using DB2. To enable your application to interface with the DB2 subsystem, you must use a link-edit procedure that builds a load module.
So if your program is accessing DB2 you need to link edit with the approriate language interface modules depending on the language being used.
Hope this helps....
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
issac1029 Intermediate

Joined: 10 Dec 2005 Posts: 159 Topics: 75
|
Posted: Mon Mar 20, 2006 10:00 am Post subject: |
|
|
kolusu,
Somebody says DSNELI is alias of DSNHLI,so I think include syslin(xxx) is to find DSNHLI to resolve the code 'call DSNHLI' which exec sql code are translted into.
So your meaning is that between program and db2,It's actually a dynamic call relationship even though it's wrote as static format? |
|
Back to top |
|
 |
Manas Biswal Intermediate

Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Tue Mar 21, 2006 10:02 am Post subject: |
|
|
issac1029,
I will try to provide an all-encompassing answer to your question. Let us know if you still have doubts.
DSNHLI is the actual routine that is called when you do an EXEC SQL. It is the run time call module for all SQLs. The following are the modules that provide an entry point to DSNHLI and you have to use according to what is appropriate for your environment -
DSNALI - CAF
DSNCLI - CICS
DSNELI - TSO
DSNRLI - RRSAF
DFSLI00 - IMS
Any address space can have only one of these environments active at a time. So, if you are running a calling and a called program in the same address space (say your TSO region), you have to link-edit the same module to both the programs.
But say, a program running in CICS is calling a DB2 stored procedure running on WLM or DB2 SPAS, then the calling program (running on the CICS address space) and the called stored procedure (running on WLM or SPAS address space) are running in two different address spaces. So, you can link-edit different modules to the calling and called programs. The calling CICS program will be linked to the DSNCLI module and the called DB2 stored procedure will be linked to the DSNRLI module.
Quote: | So your meaning is that between program and db2,It's actually a dynamic call relationship even though it's wrote as static format? |
I don't know what you mean by this. The SQL present in the EXEC SQL block is extracted out into a DBRM during DB2 pre-processing and a SQLID inserted on the call to DSNHLI builds up a reference to that SQL. The same SQLID is then used to reference the SQL in the package/plan provided during runtime. Well, of course the values of the host variables are determined during runtime. If you call that dynamic behavior, then dynamic it is.
HTH...Regards,
Manas _________________ There is no path to peace. Peace is the path.
- Mahatma Gandhi (1869-1948) |
|
Back to top |
|
 |
issac1029 Intermediate

Joined: 10 Dec 2005 Posts: 159 Topics: 75
|
Posted: Wed Mar 22, 2006 7:26 am Post subject: |
|
|
Manas Biswal,
Thanks very much
It also solved another question of mine.  |
|
Back to top |
|
 |
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Wed Mar 22, 2006 7:46 am Post subject: |
|
|
We experienced yet another phenomena in this context. Starting our program preparation process without this explicit link statement, in the resulting load module the db2 interface was placed AFTER the object deck of the compiled source module. That gave us a runtime error.
By explicitely placing the INCLUDE statement in the link step BEFORE the object deck is performing in the desired way: it works!
regards
Christian |
|
Back to top |
|
 |
issac1029 Intermediate

Joined: 10 Dec 2005 Posts: 159 Topics: 75
|
Posted: Thu Mar 23, 2006 2:37 am Post subject: |
|
|
CZerfas:
Which object deck cause this problem?Why must place it before object deck? |
|
Back to top |
|
 |
CZerfas Intermediate
Joined: 31 Jan 2003 Posts: 211 Topics: 8
|
Posted: Thu Mar 23, 2006 10:09 am Post subject: |
|
|
With "obejct deck" I mean the result of the compile of an application program. This product of the compilation can not be executed but has to be enriched with system routines into an executable load module.
Why the placement of the routines in the resulting load module is important I don't have a clue, but doing it one way doesn't work and going the other way produces a usable load module.
regards
Christian |
|
Back to top |
|
 |
Manas Biswal Intermediate

Joined: 29 Nov 2002 Posts: 382 Topics: 27 Location: Chennai, India
|
Posted: Thu Mar 23, 2006 10:28 am Post subject: |
|
|
CZerfas,
There is a particular order in which you include all the interface modules on the SYSLIN of the Link-edit steps. Depending on what modules you are including, they need to be placed before or after the object deck in the concatenation order.
See the following link for the order to be followed for different interface modules -
http://publib.boulder.ibm.com/infocenter/cicsts/v3r1/index.jsp?topic=/com.ibm.cics.ts.doc/dfhp3/dfhp3b0069.htm
Why is it so?. I don't know. It was probably designed like that.
Regards,
Manas _________________ There is no path to peace. Peace is the path.
- Mahatma Gandhi (1869-1948) |
|
Back to top |
|
 |
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Fri Mar 24, 2006 9:50 am Post subject: |
|
|
Quote: | Why is it so?. I don't know. It was probably designed like that. |
Because, by default, the first INCLUDE (and, therefore the CSECT) becomes the entry point for the load module. You can have any order of INCLUDE statements. Just code an ENTRY statement to the right CSECT and it will work fine.
So, which is the right ENTRY point? With LE, it would be generally something like CEESTART. Atleast, with PL/I programs compiled with LE, I have observed that, if I code an ENTRY statement, it abends with S0C4.
I generally follow a rule where, if X is the 'main' program that will call statically program Y, then code ENTRY for X. _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes. |
|
Back to top |
|
 |
|
|