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 make an array in a procedure accessable to whole prgm

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

New User


Joined: 07 Jun 2007
Posts: 15
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

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

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: 15
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: 186
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: 258
Location: Salem, Oregon

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: 8593
Location: Back in jolly old England

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: 186
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
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 Calling procedure with multiple entri... steve-myers PL/I & Assembler 5 Fri Jan 27, 2017 3:33 pm
No new posts Dynamic array request/response contai... Suja.Sai CICS 2 Tue Jan 24, 2017 11:37 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 6 Thu Oct 27, 2016 10:20 am
No new posts Single COPY CICS TS datasets and when... Kyle Carroll CICS 2 Tue Oct 11, 2016 9:47 pm


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