View previous topic :: View next topic |
Author |
Message |
rene_therrien@hotmail.com Beginner
Joined: 03 Mar 2006 Posts: 2 Topics: 1
|
Posted: Fri Mar 03, 2006 7:01 pm Post subject: Cobol program-id |
|
|
Hi,
Is it possible to retreive the running program's program-id? |
|
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: Sat Mar 04, 2006 10:48 am Post subject: |
|
|
Searching control blocks may not be the entire answer. (Please correct me if this is wrong since I don't know COBOL well)... As I understand it, the program-id is the name of the CSECT that the program compiles to, but a load module is usually made up of more than one CSECT and therefore more than one program-id. When the load module is linked, one or more CSECTs (program-ids) is marked entry points to the load module, and the load module is given a NAME. Therefore, finding out what load module or load module alias (entry point) is running, by searching control blocks (CDE, etc) or doing a CSVQUERY will only give you the name of the load module which may or may not be the name of a CSECT and may or may not (probably is not) the name of the CSECT currently running. The only way to determine the CSECT name, other than coding it in such a way that there are eyecatchers that are easily locatable, is to do a CSVQUERY to find the module corresponding to the PSW address, and comparing that to the output of a linkage editor mapping program like AMBLIST. But unless you are writing a debugger, I'd have to ask why don't you just hardcode a constant in your program to tell what the CSECT name is? Or if you do just want the load module name, then program-id is the wrong term to use.
(did I get that right? ) |
|
Back to top |
|
 |
Cogito-Ergo-Sum Advanced
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
|
Posted: Sat Mar 04, 2006 12:12 pm Post subject: |
|
|
Yes, semigeezer. You have got that right. _________________ 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 |
|
 |
German Castillo Beginner

Joined: 23 Dec 2005 Posts: 83 Topics: 2 Location: Caracas, Venezuela
|
Posted: Sun Mar 05, 2006 9:35 pm Post subject: |
|
|
I haven't seen a cobol assembly listing lately but I think that cobol prologue has the program Id hardcoded in its start section... _________________ Best wishes,
German Castillo |
|
Back to top |
|
 |
rene_therrien@hotmail.com Beginner
Joined: 03 Mar 2006 Posts: 2 Topics: 1
|
Posted: Sun Mar 05, 2006 10:19 pm Post subject: |
|
|
I was hoping to get away from hard-coding the CSECT name. I need this to work in CICS as well as batch. |
|
Back to top |
|
 |
|
|