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
 

 

Use subscript for index array???

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
royalchm

New User


Joined: 15 Nov 2007
Posts: 29
Location: Bangalore

PostPosted: Fri Mar 25, 2011 6:42 pm    Post subject: Use subscript for index array???
Reply with quote

can we use subscript for an index array???
02 array1 occurs 10 times index by index1.
03 element1 pic x(1)


can we use sub1 for element1????
means element1(sub1) is valid???
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Mar 25, 2011 6:52 pm    Post subject: Re: Use subscript for index array???
Reply with quote

royalchm wrote:
can we use subscript for an index array???
02 array1 occurs 10 times index by index1.
03 element1 pic x(1)


can we use sub1 for element1????
means element1(sub1) is valid???


That would depend on the definition of sub1!!!
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Fri Mar 25, 2011 6:58 pm    Post subject:
Reply with quote

So so so so so so so so so so so ...

EASY TO TEST.

How lazy can you possibly be?
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1280
Location: Belgium

PostPosted: Fri Mar 25, 2011 8:16 pm    Post subject:
Reply with quote

DB2 ?
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Fri Mar 25, 2011 8:19 pm    Post subject:
Reply with quote

Yeah - I saw the DB2 also, but just picked my favorite rant to leave some low hanging fruit for everyone else.
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 Mar 25, 2011 8:52 pm    Post subject: Reply to: Use subscript for index array???
Reply with quote

Quote:
02 array1 occurs 10 times index by index1.

This won't even compile. You're missing the DEPENDING ON clause.

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

Global Moderator


Joined: 06 Jun 2008
Posts: 7993
Location: Bellevue, IA

PostPosted: Fri Mar 25, 2011 9:08 pm    Post subject:
Reply with quote

Actually, the
Quote:
02 array1 occurs 10 times index by index1.
won't compile, but it's because INDEX is a reserved word and the statement should be
Code:
02 array1 occurs 10 times indexed by index1.
DEPENDING ON is optional.
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 Mar 25, 2011 9:39 pm    Post subject: Reply to: Use subscript for index array???
Reply with quote

Read it too fast. Thought it said OCCURS 1 TO 10 TIMES.... icon_redface.gif

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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm
No new posts Dynamic array request/response contai... Suja.Sai CICS 2 Tue Jan 24, 2017 11:37 am
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Several errors during building altern... Andi1982 JCL & VSAM 11 Wed Jul 06, 2016 7:39 pm
No new posts Drop building Alternate Index for a p... bhavin.mehta JCL & VSAM 6 Mon Jul 04, 2016 3:47 pm


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