Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
COBOL array

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

New User


Joined: 13 May 2005
Posts: 7

PostPosted: Thu May 26, 2005 3:07 pm    Post subject: COBOL array
Reply with quote

Hi,

In mainframe Cobol the array starts with 0 or with 1

Rgs,
Ganesh.K
Back to top
View user's profile Send private message

Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Thu May 26, 2005 3:19 pm    Post subject:
Reply with quote

it starts with 1.
Back to top
View user's profile Send private message
Ganesh K Rajan

New User


Joined: 13 May 2005
Posts: 7

PostPosted: Thu May 26, 2005 3:28 pm    Post subject:
Reply with quote

Deepa,

Wont it start with 0????
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Thu May 26, 2005 4:43 pm    Post subject:
Reply with quote

no it starts with 1.
Back to top
View user's profile Send private message
Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Thu May 26, 2005 5:20 pm    Post subject:
Reply with quote

To my knowledge It starts with 1.

if you try storing some value in Array(0) it will produce erroneous results
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Thu May 26, 2005 5:22 pm    Post subject:
Reply with quote

i thnk it will give OC7 when u try to access array(0)....as i faced once the same.
Back to top
View user's profile Send private message
Deepa.m
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Thu May 26, 2005 5:53 pm    Post subject:
Reply with quote

i don't think you will get a soc7 while accessing it. the data willnot get stored as expected. still u can display them. May be u got SOC7 while doing some manipulations with it.
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Thu May 26, 2005 5:56 pm    Post subject:
Reply with quote

i was getting when some how program was moving array(0) to a another working storage varibale, since that area is not defined and u r trying to access it, so in that case won't it give OC7?? Please clarify my doubt...
Back to top
View user's profile Send private message
avalanches

New User


Joined: 10 May 2005
Posts: 28

PostPosted: Fri May 27, 2005 12:15 pm    Post subject: Re: COBOL array
Reply with quote

Hi,

S0C7 can happen due to

1. Numeric operation on Non-numeric data
2. Un-initialized working-storage
3. Coding past the min/max allowed subscript
4. etc.

The move you had mentioned could belong the the 1) category in the above list.

Please correct if I'm wrong.

Cheers,
avalanches.
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Fri May 27, 2005 12:24 pm    Post subject:
Reply with quote

hi avalanches,
you are correct.I think that was happening what you had mentioned in 3rd point. well i think now Ganesh K Rajan's doub't is solved.
any comment are always welcome.... icon_biggrin.gif
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
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us