View previous topic :: View next topic |
Author |
Message |
Rasun Beginner

Joined: 20 Aug 2006 Posts: 3 Topics: 1
|
Posted: Sun Aug 20, 2006 1:34 pm Post subject: c/c++ dll load |
|
|
Folks need some help,
I am using c on mainframe. The problem I am facing is to determine from which library loadmodule is loaded. On windows platform we have command like GetModuleFileName, where the system provides the path from where it has loaded the module it is executing.
In jcl the system loads the module from one of the steplib. If their are multiple version of the load module in different steplib it will load it from the first one it finds. Is their any way in c or assembler where system have this information.
Thanks a lot for your help
-Thanks
Rakesh |
|
Back to top |
|
 |
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Sun Aug 20, 2006 1:40 pm Post subject: |
|
|
Where's the STEPLIB coded? Is it in the job? If so, what's the problem?
________
marijuana strain index
Last edited by coolman on Sat Feb 05, 2011 1:49 am; edited 1 time in total |
|
Back to top |
|
 |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Sun Aug 20, 2006 1:50 pm Post subject: |
|
|
Rasun,
Please post the JCL Code as well as the error which you are getting so that it will help members to analyse the problem and provide you with the solution. _________________ Shekar
Grow Technically |
|
Back to top |
|
 |
Rasun Beginner

Joined: 20 Aug 2006 Posts: 3 Topics: 1
|
Posted: Sun Aug 20, 2006 2:16 pm Post subject: |
|
|
ok sir,
May be my post was not clear. There is no error. The requirement is to do some hash check on the called module. Let me do this with an example.
I have program 1. It calls a vendor program VP. Now the call is dynamic, so during the run time it will load the module from the steplib. In the steplib we have multiple library, In a perfect world the loadmodule should exist in only one of the steplib. But as people build there own jcl they concatenate different PDS in there steplib. The steplib now they are using for the vendor program is not the latest version. so the requirement is we call a program which figures out what library the loadmodule has been loaded. Open the load library and read the member as a file. Run some hash algorithm on the member and compares the value of the hash with the latest has stored in anotherfile. If it matches then we are using the correct version and remaining function can be executed, If the hash does not match then we have taken a wrong loadmodule and program should abend.
Hope this is a better explanation, If not please let me know
-Thanks
Rakesh |
|
Back to top |
|
 |
coolman Intermediate
Joined: 03 Jan 2003 Posts: 283 Topics: 27 Location: US
|
Posted: Sun Aug 20, 2006 5:53 pm Post subject: |
|
|
Some more questions :
1. Do you want to pick up the latest module of vendor program? or do you want to pick up the vendor program that's right?
2. Have you already coded the logic for doing the hash algorithm? You've stated that you want to compare the hash value provided by your program w/ another value hash value stored in another file?
According to my understanding, you need a program that does the following :
1. Open a load module PDS and read the member VP
2. Run a hash algorithm on this member and get a hash value
3. Compare the hash value w/ another value stored at someplace else (not sure if vendor provides you the information)
4. If it matches, write out the steplib dataset, else keep looking for it in the next dataset
Quote: |
In the steplib we have multiple library, In a perfect world the loadmodule should exist in only one of the steplib. But as people build there own jcl they concatenate different PDS in there steplib. The steplib now they are using for the vendor program is not the latest version.
|
Whichever dataset containing the called vendor program loadlib appears first in the concatenation would be picked up. No matter whether your hashing algorithm matches or not.
Maybe I'm missing something here
________
PSR-S500
Last edited by coolman on Sat Feb 05, 2011 1:49 am; edited 1 time in total |
|
Back to top |
|
 |
Rasun Beginner

Joined: 20 Aug 2006 Posts: 3 Topics: 1
|
Posted: Sun Aug 20, 2006 6:52 pm Post subject: |
|
|
No sir, You are not missing anything. The load module will be picked from the library where it can be found the first time but by doing hash on the module we can make a decision to proceed or not to proceed.
Now as you have suggested
1. Open load module PDS and read the member VP. This is where the problem exist how do i determine what loadmodules have been concatenated.
I was taking the alternate approach of finding if system can tell me where it loaded the module from or something like what are libraries concatnated in the steplib and then I can take that information loop thru the dsn in steplib and look for the member.
Please let me know if I missed anything
-Thanks
Rakesh |
|
Back to top |
|
 |
|
|