MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Index with more than 4 bytes

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Subzero
Beginner


Joined: 02 Dec 2002
Posts: 19
Topics: 7
Location: Chennai, India

PostPosted: Wed Mar 22, 2006 5:35 am    Post subject: Index with more than 4 bytes Reply with quote

Hi,
I am struck up with a problem of having a very big COBOL table of 99999 items but cannot use index because the number of items (5 bytes) is more than what an index could accomodate (4 bytes). Is there a way to specify full-word index instead of a half-word index?

Cheers,
SubZero
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Mar 22, 2006 5:37 am    Post subject: Reply with quote

Subzero,

Why not define your own index item ?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Subzero
Beginner


Joined: 02 Dec 2002
Posts: 19
Topics: 7
Location: Chennai, India

PostPosted: Wed Mar 22, 2006 6:25 am    Post subject: Reply with quote

Kolusu,
Do you mean using subscripts? Or if i use a variable defined with USAGE IS INDEX, can that accomodate 99999 items? I know you would not be happy with me asking this without reading manuals, but can you elaborate on using own index item?

Cheers,
SubZero
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Wed Mar 22, 2006 8:33 am    Post subject: Reply with quote

Subzero,

Look at the following sample

Code:

WORKING-STORAGE SECTION.                       
                                               
01 TEST-KEY.                                   
   05 NUM-TBL OCCURS 1200000 TIMES             
      ASCENDING KEY UNQ-NUM INDEXED BY IDX.     
      10 UNQ-NUM   PIC 9(08).                   
                                               
01 WS-NUM          PIC 9(08) VALUE 1.           
                                               
PROCEDURE DIVISION.                             
                                               
    PERFORM VARYING IDX FROM 1 BY 1             
      UNTIL IDX > 1200000                       
       MOVE WS-NUM              TO UNQ-NUM(IDX)
       ADD +1                   TO WS-NUM       
    END-PERFORM                                 
                                               
    PERFORM VARYING IDX FROM 1000000 BY 1       
      UNTIL IDX > 1000030                       
       DISPLAY UNQ-NUM(IDX)                     
    END-PERFORM                                 
                                               
    GOBACK.                                     
                                               


Hope this helps....

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Subzero
Beginner


Joined: 02 Dec 2002
Posts: 19
Topics: 7
Location: Chennai, India

PostPosted: Wed Mar 22, 2006 9:17 am    Post subject: Reply with quote

Thanks Kolusu, the question sounds silly in the hindsight.

Cheers,
SubZero
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group