View previous topic :: View next topic |
Author |
Message |
mehta_ac Beginner
Joined: 15 Nov 2006 Posts: 3 Topics: 3
|
Posted: Thu May 17, 2007 1:55 am Post subject: Switching stacks |
|
|
Hi,
Normally we create new stack and delete them as and when required. But is it possible to refer data lying in one of the other existing stack (created with in the same program)? I mean switching from one stack to another. If yes, please show an example to do it.
Thanks,
Anand |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Thu May 17, 2007 2:50 am Post subject: |
|
|
I believe (probably wrong!) that you can have multiple stacks but only the latest created is available, older ones become available as you delete newer ones. If that is the case, and you need to acces your data in parallel with the new stack then your best(?) bet would be to write your data to a stem variable and use it from there. But I am ready for enlightenment! _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
expat Intermediate

Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Thu May 17, 2007 5:05 am Post subject: |
|
|
I agree with Nic, but there again we may both be wrong. _________________ If it's true that we are here to help others,
then what exactly are the others here for ? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu May 17, 2007 7:36 am Post subject: |
|
|
mehta_ac,
Hmm I think it is possible. Create a stack in the main exec and if you want another stack call a subroutine to issue NEWSTACK command. NEWSTACK creates a private data stack that is completely isolated from the original data stack. The elements on the original data stack cannot be accessed by an exec or the routines that it calls until a DELSTACK command is issued. When there are no more elements in the new data stack, information is taken from the terminal.
When an exec wants to delete the new stack and remove all elements placed on the new stack, it can issue the TSO/E REXX DELSTACK command. The DELSTACK command removes the most recently created data stack. If no stack was previously created with the NEWSTACK command, DELSTACK removes all the elements from the original stack.
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
DaveyC Moderator

Joined: 02 Dec 2002 Posts: 151 Topics: 3 Location: Perth, Western Australia
|
Posted: Thu May 17, 2007 8:04 am Post subject: |
|
|
You can't switch stacks because they don't have a handle. As you know you can nest
them, but switching is not an option. _________________ Dave Crayford |
|
Back to top |
|
 |
|
|