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
 

 

Array passing

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
naresh15

New User


Joined: 20 May 2010
Posts: 2
Location: hyderabad

PostPosted: Tue Jun 15, 2010 8:45 am    Post subject: Array passing
Reply with quote

How to pass an array to a subprogram?
Plz give response to this.
Back to top
View user's profile Send private message

naresh15

New User


Joined: 20 May 2010
Posts: 2
Location: hyderabad

PostPosted: Tue Jun 15, 2010 8:47 am    Post subject: File passing
Reply with quote

How to pass a file to subprogram?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Jun 15, 2010 8:52 am    Post subject: Re: Array passing
Reply with quote

naresh15 wrote:
How to pass an array to a subprogram?
Plz give response to this.
CALL subprogram USING array.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Jun 15, 2010 8:53 am    Post subject: Re: File passing
Reply with quote

naresh15 wrote:
How to pass a file to subprogram?
Define 'file'.
A file name?
A file record?
A file contents?
Back to top
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Thu Jul 08, 2010 6:18 pm    Post subject: Reply to: Array passing
Reply with quote

Quote:
How to pass an array to a subprogram?


The question could be better framed as:

How to pass an Indexed array to a subprogram ?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Jul 08, 2010 6:38 pm    Post subject:
Reply with quote

It would only be an Indexed cobol internal table
if the data definition included the INDEXED BY clause.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Thu Jul 08, 2010 7:20 pm    Post subject:
Reply with quote

and,

the definition of the CALLing program has no influence.

only the definition in Linkage of the CALLed program.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Thu Jul 08, 2010 7:46 pm    Post subject: Reply to: Array passing
Reply with quote

Note: When the sub-program receives control and obtains array-addressability, using the passed-array address, the associated indices of the array are NOT set to the values set by the caller (if applicable).

Bill
Back to top
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Thu Jul 08, 2010 11:39 pm    Post subject: Reply to: Array passing
Reply with quote

Yes bill,

I got it. The array(indexed or non indexed) could be passed the same way in both cases. In case of indexed the the index value needs to be sent via some other numeric variable, in order to retain the index information of calling program.

Thanks.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Jul 09, 2010 12:07 am    Post subject: Reply to: Array passing
Reply with quote

Yes, that's correct. A preferable variable will be defined as S9(08) COMP (or COMP-5, if your compiler supports this).

You can pass intelligence to the sub-program by moving -1 (X'FFFFFFFF') to this COMP/COMP-5 parameter.

When the sub-program gains control and finds this negative 1 value, then this would indicate that the associated index needs to be set to 1.

Or instead of a -1, a ZERO could also be used to inform the sub-program to set the associated index to 1.

Any value greater than ZERO, the associated index is set to the COMP/COMP-5 parameter.

Bill
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts Dynamic array request/response contai... Suja.Sai CICS 2 Tue Jan 24, 2017 11:37 am
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts Unstring list of values into an array. Roshnii COBOL Programming 8 Mon Jun 27, 2016 6:25 pm
No new posts Passing information through JCL as in... Pia Baruah JCL & VSAM 5 Wed May 25, 2016 2:22 pm


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