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

Diff. between subscript and index with examples


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
karthi_ind

Active User


Joined: 24 Feb 2004
Posts: 131
Location: Chennai

PostPosted: Tue May 04, 2004 10:10 pm
Reply with quote

hello everybody

1. Explain call by value and call by reference with examples.

2. Explain STRING function WITH POINTER option.

3. Explain Static Call and Dynamic call with examples.

4. Diff. between subscript and index with examples.

5. Diff. between Search and Search All.

Plz answer these questions early. These are mostly asked interview questions.

bye

karthi G.
Back to top
View user's profile Send private message
mvs_butta

New User


Joined: 23 Dec 2003
Posts: 13

PostPosted: Wed May 05, 2004 5:57 pm
Reply with quote

These are all basic questions , you can find the answers in any standard cobol book or refer to any manual
Back to top
View user's profile Send private message
pankajupadhyay
Warnings : 1

New User


Joined: 04 May 2007
Posts: 13
Location: pune

PostPosted: Sun May 06, 2007 7:16 pm
Reply with quote

if u want to sand only value of a particular variable from main pgm to sub pgm then its called called call by value, in this method main pgm and sub pgm use diffrent memory location .
when u use call by refrence that means u are sending address of identifier which u sending from main pgm to sub pgm , in that case sending and reciving feild use same memory location. ex

MAIN PGM.
W-S SECTION.
77 A PIC 999 VALUE IS 20.
77 B PIC 999 VALU IS 30
77 C PIC 999 VALUE ZEORS.
PROC.. DIV..

CALL 'SUBPGM' USING CALL BY VALUE A,B.
CALL BY REFRENCE C.
DISPLAY A
DISPLAY B
DISPLAY C
---------------------------------------------------------
SUB PGM.
L-K SECTION.
77 P PIC 999.
77 Q PIC 999.
77 R PIC 999.
PROCEDURE DIVISION USING P, Q ,R.
COMPUTE C = A + B.
DISPLAY C.

-----------------------------
OUT PUT
A = 20
B= 30
C= 50
P =20
Q= 30
R= 50
Here c and r using same memory location
but a, b and p,q are not
Back to top
View user's profile Send private message
pankajupadhyay
Warnings : 1

New User


Joined: 04 May 2007
Posts: 13
Location: pune

PostPosted: Sun May 06, 2007 7:22 pm
Reply with quote

subscript is integer variable which u define in a w-s section
but index is displacement which u write along with table declaration
with occurs clause
Back to top
View user's profile Send private message
pankajupadhyay
Warnings : 1

New User


Joined: 04 May 2007
Posts: 13
Location: pune

PostPosted: Sun May 06, 2007 7:26 pm
Reply with quote

search is seq. search but search all use for binary search.
search is good for small records and search all good for big records

and u can also add diff b/w seq and binary search
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sun May 06, 2007 11:11 pm
Reply with quote

Hello,

You will find additional info about each of your questions if you search the forums.

Each has already been answered.
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 -> Mainframe Interview Questions

 


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 DL/I status code AK for GU call using... IMS DB/DC 1
No new posts Can you give me examples of programs ... CLIST & REXX 22
No new posts Add column to existing records using ... JCL & VSAM 2
Search our Forums:

Back to Top