MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cobol program-id

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
rene_therrien@hotmail.com
Beginner


Joined: 03 Mar 2006
Posts: 2
Topics: 1

PostPosted: Fri Mar 03, 2006 7:01 pm    Post subject: Cobol program-id Reply with quote

Hi,

Is it possible to retreive the running program's program-id?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sat Mar 04, 2006 9:21 am    Post subject: Reply with quote

rene_therrien@hotmail.com,

Please SEARCH before posting. Check this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=1657&highlight=cob2job

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Sat Mar 04, 2006 10:48 am    Post subject: Reply with quote

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? Question )
Back to top
View user's profile Send private message Visit poster's website
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Sat Mar 04, 2006 12:12 pm    Post subject: Reply with quote

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
View user's profile Send private message
German Castillo
Beginner


Joined: 23 Dec 2005
Posts: 83
Topics: 2
Location: Caracas, Venezuela

PostPosted: Sun Mar 05, 2006 9:35 pm    Post subject: Reply with quote

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
View user's profile Send private message
rene_therrien@hotmail.com
Beginner


Joined: 03 Mar 2006
Posts: 2
Topics: 1

PostPosted: Sun Mar 05, 2006 10:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group