View previous topic :: View next topic |
Author |
Message |
Pudah Beginner
Joined: 20 Jun 2003 Posts: 27 Topics: 8 Location: East of the Rock, West of the Hard Place
|
Posted: Mon Sep 18, 2006 5:18 pm Post subject: From which load lib was program executed |
|
|
Do any of you know a method to use to get an assembler program to write out what load library it was executed from? I've searched the forum on all of the terms that I could think of and nothing turns up. Same with the HLASM Programmer's Guide and Language Reference. Any of you ever do this? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Mon Sep 18, 2006 8:54 pm Post subject: |
|
|
If you want the program to do it by itself, then get the address of the program, do a CSVQUERY macro against it. Its been years since I did this, but I think that will give you back enough information to chase this down. There is a control block called the CDE that you want to look for and I think it contains something like the tiot entry # for the data set from which the module was loaded. It is something like that. There are some publicly available programs with source (SHOWMVS for example) that do things like this. Some of the interfaces they use are not intended programming interfaces, but they seem to work for now. |
|
Back to top |
|
 |
Pudah Beginner
Joined: 20 Jun 2003 Posts: 27 Topics: 8 Location: East of the Rock, West of the Hard Place
|
Posted: Tue Sep 19, 2006 4:10 am Post subject: |
|
|
kolusu, I really need to improve my search skills, because I should have been able to find that thread. Unfortunately it doesn't help me.
semigeezer, yes, I do want the program to do it itself. That is, if I have the following execution JCL:
Code: | //RUN EXEC PGM=MYPROG
//STEPLIB DD DSN=SYSTEM.LOAD.LIB,DISP=SHR
// DD DSN=MY.LOAD.LIB1,DISP=SHR
// DD DSN=MY.LOAD.LIB2,DISP=SHR
// DD DSN=MY.LOAD.LIB3,DISP=SHR
//SYSPRINT DD SYSOUT=*
//*
|
and if we assume that there are copies of MYPROG is contained in MY.LOAD.LIB2 and MY.LOAD.LIB3, I want MYPROG to display something like
EXECUTED FROM: MY.LOAD.LIB2
since it would be picked up from there before the version that is in MY.LOAD.LIB3.
I will look into the CSVQUERY macro and see what I can figure out. |
|
Back to top |
|
 |
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Tue Sep 19, 2006 12:22 pm Post subject: |
|
|
If you will always be using STEPLIB, you can use BLDL on a DCB against STEPLIB and find the concatenation # from there. But if you will eventually be running from link list or other source, CSVQUERY is the way to go. |
|
Back to top |
|
 |
bauer Intermediate
Joined: 10 Oct 2003 Posts: 317 Topics: 50 Location: Germany
|
Posted: Wed Sep 20, 2006 1:17 am Post subject: |
|
|
Is any sample coding available ? |
|
Back to top |
|
 |
Pudah Beginner
Joined: 20 Jun 2003 Posts: 27 Topics: 8 Location: East of the Rock, West of the Hard Place
|
Posted: Wed Sep 20, 2006 6:25 pm Post subject: |
|
|
There is a very complex example in the SHOWMVS program that semigeezer mentioned (you can get it from the CBT tape lib) |
|
Back to top |
|
 |
|
|