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 

PLAN NAME or COLLID at runtime in COBOL program

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
pradeepg
Beginner


Joined: 06 Jan 2003
Posts: 25
Topics: 12
Location: Columbus, OH

PostPosted: Tue Dec 06, 2005 6:48 pm    Post subject: PLAN NAME or COLLID at runtime in COBOL program Reply with quote

Hi,

Is there a way I can find out to which PLAN or COLLID the program belongs at run time. Any DB2 reserve words ?? I don't think I can get this in SQLCA. Based on the PLAN/COLLID I can decide if it is a batch or online program. So I am trying to find out is there a way to findout the plan name or collid of the program at runtime.

Thanks in advance.

- Pradeep
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
chandrankk
Beginner


Joined: 06 Dec 2005
Posts: 8
Topics: 0

PostPosted: Tue Dec 06, 2005 11:36 pm    Post subject: Reply with quote

Try this

EXEC SQL
VALUES(CURRENT PACKAGESET)
INTO(:HV1)

your host variable should have the collection id. I think, there are some limitations for using this like if the program is running from a remote location, you may not get the proper value.

regards.
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: Wed Dec 07, 2005 6:29 am    Post subject: Reply with quote

Quote:

Based on the PLAN/COLLID I can decide if it is a batch or online program.

pradeepg,

Check this link which shows how to differentiate between a batch program and online invoking

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

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
pradeepg
Beginner


Joined: 06 Jan 2003
Posts: 25
Topics: 12
Location: Columbus, OH

PostPosted: Wed Dec 07, 2005 1:34 pm    Post subject: Reply with quote

kolusu,

The code you provided can be used in calling programs also right. Will it work in lower level programs.

Chandrankk,

CURRENT PACKAGESET will have blank initially isn't it ???
because I am getting blank in the host variable. I think manual also says that, only after you set this special register with some value then it will have a value other wise it will be blank. OR did I understand it wrong?
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Manas Biswal
Intermediate


Joined: 29 Nov 2002
Posts: 382
Topics: 27
Location: Chennai, India

PostPosted: Wed Dec 07, 2005 5:05 pm    Post subject: Reply with quote

pradeepg,

Quote:

Is there a way I can find out to which PLAN or COLLID the program belongs at run time. Any DB2 reserve words ?? I don't think I can get this in SQLCA. Based on the PLAN/COLLID I can decide if it is a batch or online program.


You mean to say that you bind and compile the same program to two different plans - one for batch and online?. If no, then the same plan will be used for both online and batch invocations and if yes, why?

Regards,
Manas
_________________
There is no path to peace. Peace is the path.
- Mahatma Gandhi (1869-1948)
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database 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