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 

Cobol Internal Table

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


Joined: 27 Aug 2007
Posts: 102
Topics: 42
Location: Chennai

PostPosted: Wed Oct 10, 2007 7:19 am    Post subject: Cobol Internal Table Reply with quote

Code:
05  WS-CRIT-TABLE             OCCURS    2000 TIMES             
                           ASCENDING KEY WS-CRIT-JOB-NAME
                           INDEXED BY CRIT-IX.           
    10  WS-CRIT-JOB-NAME   PIC X(8) VALUE SPACES.         


I'm using this code to create an internal table with 2000 occurences of WS-CRIT-JOB-NAME. SEARCH, SEARCH ALL and all the table functions are working fine. I am able to read from the table, update and do everything.

But the problem is it creates only 1000 occurences. I tried increasing it to OCCURS 4000 TIMES, even then it is creating only 1000 occurences. I did a trace on this program and even there in the working storage section it has allocated only upto WS-CRIT-JOB-NAME[1000]. When I try to move beyond 1000, it says "Subscript out of Range". I am using
WS-CRIT-JOB-NAME(WS-I) to access this table and ws-i is defined with 9(08).
_________________
Thanks
Back to top
View user's profile Send private message Yahoo Messenger
edkir98
Beginner


Joined: 27 Aug 2007
Posts: 102
Topics: 42
Location: Chennai

PostPosted: Wed Oct 10, 2007 7:23 am    Post subject: Reply with quote

contd..
WS-CRIT-JOB-NAME(WS-I) to access this table and ws-i is defined with
9(8)
_________________
Thanks
Back to top
View user's profile Send private message Yahoo Messenger
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Wed Oct 10, 2007 7:34 am    Post subject: Reply with quote

edkir98 wrote:
contd..
WS-CRIT-JOB-NAME(WS-I) to access this table and ws-i is defined with
9(8)
Preview then disable smiles....
Back to top
View user's profile Send private message
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Wed Oct 10, 2007 7:37 am    Post subject: Reply with quote

Exactally who is saying"Subscript out of Range"?
Runtime error? Message number? Abend?
Compile time error? Message number?
Any message number?
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Wed Oct 10, 2007 7:42 am    Post subject: Reply with quote

edkir98,


Try creating the same table as variable length table using DEPENDING ON clause.
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
edkir98
Beginner


Joined: 27 Aug 2007
Posts: 102
Topics: 42
Location: Chennai

PostPosted: Wed Oct 10, 2007 8:14 am    Post subject: Reply with quote

CICS Guy,
Trace Master is showing up this "Subscript Out of Range" error when WS-I becomes more than 1000. But the job is not abending

vivek,
Your suggestion is working.. Thanks.. But what difference would it have made? I dont understand. Can u explain
_________________
Thanks
Back to top
View user's profile Send private message Yahoo Messenger
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Wed Oct 10, 2007 2:43 pm    Post subject: Reply with quote

Why are you defining this table with an index but accessing it with a subscript? Which one are you using to load the table?
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Sat Nov 10, 2007 9:51 am    Post subject: Reply with quote

Hi Ed,

Are you sure the table was loaded in WS-CRIT-JOB-NAME order?
_________________
Regards, Jack.

"A problem well stated is a problem half solved" -- Charles F. Kettering
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Sat Nov 10, 2007 5:01 pm    Post subject: Reply with quote

are you not getting somekind of warning? about the value clause:
Code:
10  WS-CRIT-JOB-NAME   PIC X(8) VALUE SPACES.   

_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
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