IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to push the variable into stack in


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
awyn

New User


Joined: 11 Feb 2008
Posts: 49
Location: chennai

PostPosted: Fri Feb 22, 2008 1:02 pm
Reply with quote

how to push the variable into stack in
rexx and how to access them individually
in my program
in a loop i= 1 to 10
i have values 1 3 4 1 5 1 inside the loop, if i encount 1 i want to push the variable(say i=1 and i=4 here).then i want to pull the variables individually .how to do it
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Fri Feb 22, 2008 1:09 pm
Reply with quote

If I understood you correctly... search for PUSH,PULL,QUEUE, Newstack, Delstack.... in the Rexx manual.
Back to top
View user's profile Send private message
kavya123
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 34
Location: hyderabad

PostPosted: Mon Feb 25, 2008 12:38 pm
Reply with quote

Hi.
By this way you can push the variable into stack in rexx and also access them individually


Code:
Push ABC                                   /* puts ‘ABC’ in top of stack */
Push stpaul                                /* puts ‘stpaul’ over ‘ABC’ */                                 
pull data                                     /* pulls data from the top of stack */
say ‘from the stack ‘ data          /* displays ‘stpaul’ */
pull data                                     /* pulls data from top of stack */
say ‘from the stack ‘ data          /* displays ‘ABC’ */
pull data                                     /* obtains input from tso terminal */



Kavya.Y
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Feb 25, 2008 12:45 pm
Reply with quote

You can't get a value directly from the middle of the stack; you have to read the stack sequentially.

O.
Back to top
View user's profile Send private message
kavya123
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 34
Location: hyderabad

PostPosted: Mon Feb 25, 2008 1:39 pm
Reply with quote

Ofer,

To get the values directly from the middle of the stack.
I think we need to create a new stack.

Correct me if i am wrong.

Code:
"NEWSTACK"                          /* creates new stack */
Push CTS                                   /* puts ‘CTS’ in top of stack */
Push stpaul                                /* puts ‘stpaul’ over ‘CTS’ */                                 
pull data                                     /* pulls data from the top of stack */
say ‘from the stack ‘ data          /* displays ‘stpaul’ */
pull data                                     /* pulls data from top of stack */
say ‘from the stack ‘ data          /* displays ‘CTS’ */
pull data                                     /* obtains input from tso terminal */
"DELSTACK"                           /* delete stack */



kavya.Y
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Feb 25, 2008 1:57 pm
Reply with quote

Sure, you can create a new stack for each item.... icon_biggrin.gif .... but i don't think this is a good programming practice (not to mention resources and performance).

O.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top