Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
how to make an array in a procedure accessable to whole prgm

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
anilsanda

New User


Joined: 07 Jun 2007
Posts: 14
Location: chennai

PostPosted: Mon Jul 02, 2007 12:40 pm    Post subject: how to make an array in a procedure accessable to whole prgm
Reply with quote

hi,
how an array that is created in a procedure of a program can be made available(accessable) to whole of that program.i have an array in a procedure of my program,i have to access that array in a call function of the same program,but i couldnt do it.
/rexx/
fun = first
call subprg
first:procedure
fields.i
return
subprg:
field.i
return
Back to top
View user's profile Send private message
References
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 3564
Location: Brussels once more ...

PostPosted: Mon Jul 02, 2007 3:06 pm    Post subject:
Reply with quote

Take a look at the EXPOSE parameter
Back to top
View user's profile Send private message
anilsanda

New User


Joined: 07 Jun 2007
Posts: 14
Location: chennai

PostPosted: Mon Jul 02, 2007 6:35 pm    Post subject:
Reply with quote

hi,
i have used expose parameter in my prgm as

first:
procedure expose field.i /* field.i is an array */
arg field.i
field.i = cocode
return field.i

subprg:
say "field" field.i /* i want to display the contents of array in this
return /* called subprg......but i am not able to do so */
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 192
Location: India

PostPosted: Mon Jul 02, 2007 7:20 pm    Post subject:
Reply with quote

Hey anil,
By sub-program what u want to mean? Obviously the sub-program (in ur word) is not lying ur main program (calling program). If it is so, u cannot pass the stem from calling program to called sub-proram directly. But there is other way out! U can make the stem into a string with some seperator! By using this seperator in the called sub program, u will break up the entire string and put it into a new stem. Again when u want to pass this stem back to the main program u have follow the way...

icon_biggrin.gif Correct me if I am wrong !!!!!! icon_razz.gif
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 126

PostPosted: Mon Jul 02, 2007 7:43 pm    Post subject:
Reply with quote

Where is field.i set.?? i is an index into the array and should have been
set prior to the call.

do i = 1 to field.o
say 'field ='field.i
end


field.0 = 5

do i = 1 to field.0
field.i = 'hello'
end
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 3564
Location: Brussels once more ...

PostPosted: Mon Jul 02, 2007 10:39 pm    Post subject:
Reply with quote

Are you calling a procedure within your REXX or a completely different REXX EXEC ?
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 192
Location: India

PostPosted: Tue Jul 03, 2007 10:09 am    Post subject:
Reply with quote

Hey expat,
That's what I have already asked anilsanda but with no reply. Waiting to listen from him soon!!! icon_biggrin.gif
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1