IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Use subscript for index array???


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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
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

Senior Member


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

PostPosted: Fri Mar 25, 2011 6:58 pm
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: 1281
Location: Belgium

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

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

Senior Member


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

PostPosted: Fri Mar 25, 2011 8:19 pm
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Mar 25, 2011 8:52 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Mar 25, 2011 9:08 pm
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Mar 25, 2011 9:39 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Cobol file using index COBOL Programming 2
No new posts Finding faulty logic Subscript out of... COBOL Programming 5
No new posts COBOL Ascending and descending sort n... COBOL Programming 5
No new posts DL/I status code AK for GU call using... IMS DB/DC 1
No new posts To find an array of words (sys-symbol... JCL & VSAM 9
Search our Forums:

Back to Top