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 

How to cancel a static CALL.

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


Joined: 13 Jun 2003
Posts: 7
Topics: 3

PostPosted: Fri Oct 31, 2003 5:47 am    Post subject: How to cancel a static CALL. Reply with quote

Hi all,

I am facing a problem while giving a second static call to a subroutine. Actually when I am calling the subroutine for the first time one switch is being set in the subroutine. And when I am calling it again it is not giving the desired results as the switch is already being set.
Is their any way to call a fresh copy of that subroutine in which the switch will have its intial value.
I tried the command CANCEL 'program-name' before the second call but it is not working. I think this command used is to get a fresh copy for dynammic call.
I am looking forward for your valuable advise.

Thanks and Regards,
Vineet.
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: Fri Oct 31, 2003 6:46 am    Post subject: Reply with quote

vspangtey,


code INITIAL on the program-id of the subprogram and it will be in initial state for every call


Hope this helps...

cheers

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Fri Oct 31, 2003 3:23 pm    Post subject: Reply with quote

Hi Vineet,

I don't get it. If the code has 1st time logic in it, I guess that's the way it's supposed to work. I'm assuming this sub module is used by others, so changing its intent may not be a good idea.

However, if you have a need to use it differently as you outlined, you may want to call it dynamically and then use cancel to re-init it between calls.

Regards, Jack.
Back to top
View user's profile Send private message
vspangtey
Beginner


Joined: 13 Jun 2003
Posts: 7
Topics: 3

PostPosted: Fri Oct 31, 2003 11:40 pm    Post subject: Reply with quote

Hi,

The subroutine is a standard program and it is running in the production. So, its not possible to change the subroutine and as Jack said it is used by other modules also. The way of calling the program is also unique and it always being called statically. Its because of the requirement that I have to call it twice.
I was looking for some alternative way so that it won't hurt the standards followed.
Thanks to all for ur help.

Regards,
Vineet.
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Sat Nov 01, 2003 2:24 pm    Post subject: Reply with quote

Hi Vineet,

Why don't you talk to The Powers That Be and explain the situation to them. They may allow you to do Dynamic calls with an intervening cancel. Or they may have a "workaround" that you can use.

I find it hard to beleive that they have newver faced the need to reinit a subpgm before.

Regards, Jack.
Back to top
View user's profile Send private message
haatvedt
Beginner


Joined: 14 Nov 2003
Posts: 66
Topics: 0
Location: St Cloud, Minnesota USA

PostPosted: Fri Nov 14, 2003 10:08 pm    Post subject: Reply with quote

Vineet, why not just add code to the subroutine to initialize all the fields that have to be initialized every time the program is executed ? this is usually standard procedure for writing a reusuable subroutine.

It is very bad form to use the cancel verb, as it deallocates the storage and then the subsequent call has to allocate the storage again. This adds a considerable overhead to a process which may call the subroutine millions of times (we have many common subroutines like this).

As a general rule I would recommend that you only use the "CANCEL" verb for a module which is ONLY called once during a run unit. With today's virtual storage management in Z/OS or OS/390 this benefits of doing this are usually very small. I would also recommend that you NOT use the "INITIAL" phrase on the PROGRAM-ID statement, as this is usually counter productive. Smile
_________________
Chuck Haatvedt

email --> clastnameatcharterdotnet

(replace lastname, at, dot with appropriate
characters)
Back to top
View user's profile Send private message
neilxt
Beginner


Joined: 01 Mar 2004
Posts: 23
Topics: 1

PostPosted: Wed May 12, 2004 4:44 pm    Post subject: Reply with quote

Quote:

am facing a problem while giving a second static call to a subroutine. Actually when I am calling the subroutine for the first time one switch is being set in the subroutine. And when I am calling it again it is not giving the desired results as the switch is already being set.
Is their any way to call a fresh copy of that subroutine in which the switch will have its intial value.
I tried the command CANCEL 'program-name' before the second call but it is not working. I think this command used is to get a fresh copy for dynammic call.
I am looking forward for your valuable advise.

I've read the thread through and the consensus answer seems to be "it depends what you're actually trying to do". Can you be more specific about why you need it to operate differently than everybody else who uses it?
Back to top
View user's profile Send private message Send e-mail
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