Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to push the variable into stack in

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: How to push the variable into stack in
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    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Mon Feb 25, 2008 12:45 pm    Post subject:
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    Post subject:
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: 2360
Location: Israel

PostPosted: Mon Feb 25, 2008 1:57 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts OPC JCL Variable passion_sujesh IBM Tools 5 Fri Jul 01, 2016 4:21 am
No new posts JOINKEYs and Variable files migusd SYNCSORT 8 Fri Jun 17, 2016 3:16 am
No new posts File Manager with Variable Length File ahabib IBM Tools 10 Thu Mar 31, 2016 11:00 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us