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
 
Diff b/w INDEX & SUBSCRIPT, Use of FILLER Clause

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

Active User


Joined: 24 Feb 2004
Posts: 131
Location: Chennai

PostPosted: Mon Jun 14, 2004 3:01 pm    Post subject: Diff b/w INDEX & SUBSCRIPT, Use of FILLER Clause
Reply with quote

hi to all


my question is


1) What is the diff. b/w index and subscript?

2) what r diff. types of divisions. I saw in a book that thr
are 6 division. i know only 4 div. id div,en div,data div,proc div
what are all the other two div.

3) whatz the use of filler clause?
Back to top
View user's profile Send private message

meetsrk

New User


Joined: 13 Jun 2004
Posts: 85

PostPosted: Mon Jun 14, 2004 7:39 pm    Post subject:
Reply with quote

hi karthik_ind,

for question...
1. difference b/w index and subscript is
Index is defined in occurs clause i.e for example,

02 LETTER REDEFINES TABLEVAL.
03 LETVAL PIC X OCCURS 26 TIMES INDEXED BY LTIDX.
...
...
add 1 to LTIDX. ===> cannot be done. yields to error

so here, LETVAL array can only be accesed by LTIDX
ie LETVAL(LTIDX). you cannot use any other integer variable.
LTIDX is called the index. and it initialized using SET verb. also we cannot use index variable for any arithmatic operation.


whereas,
Subscript is a normal variable used for accessing the array.
for e.g,

working-storage section.
77 i pic 9.
77 a pic x occurs 26 times.
...
...
...
procedure division.
...
...
add 1 to i. ===> can be done
display a(i).
...
...

so here, I is the subscript, here u can use that variable 'i' for any function, ie we can increment, decrement etc.


2. let me check it out and later answer it.
Back to top
View user's profile Send private message
meetsrk

New User


Joined: 13 Jun 2004
Posts: 85

PostPosted: Mon Jun 14, 2004 7:45 pm    Post subject:
Reply with quote

for question..
3. Filler clause is used where we need some data that should not be assigned to the variables.

for e.g, to display a heading for a report like

ABC Company


eq. code is,

01 header.
02 filler pic x(75) value 'ABC COMPANY'.
...
...
...
....
display header.
Back to top
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1200
Location: India

PostPosted: Tue Jun 15, 2004 12:22 pm    Post subject: Re
Reply with quote

Quote:
1) What is the diff. b/w index and subscript?


Index variables access the array element using the displacement (memory address), while subscript access the array using occurance number (position). Indixes are more faster and can be used to search the table.

Quote:
2) what r diff. types of divisions. I saw in a book that thr
are 6 division. i know only 4 div. id div,en div,data div,proc div
what are all the other two div.


There are 4 divisions only in COBOL. I beleive, you misunderstand with the 6 sections in data division.


Quote:
3) whatz the use of filler clause?


Used to initialize an undeclared element.
Used to reserve memory for future use
Used to declare constants
Used to save memory area
Used to initialize a table
Back to top
View user's profile Send private message
jagdishmudiraj

New User


Joined: 25 Apr 2007
Posts: 7
Location: gurgaon

PostPosted: Wed Jun 20, 2007 6:51 pm    Post subject:
Reply with quote

Subscrip------ its an occurence
whereas
Index---------- its an displacement from the starting position
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 Confusion b/w index and subscript Deepak kumar25 Mainframe Interview Questions 7 Thu Aug 31, 2017 6:50 am
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts setting new limit Key values for inde... srilata83 DB2 1 Fri Feb 10, 2017 9:24 pm
No new posts Order BY AND Index Nileshkul DB2 2 Sat Dec 31, 2016 6:33 pm
No new posts Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm

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