Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Some COBOL Interview Questions....

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
shiva_suresh
Warnings : 2

New User


Joined: 05 May 2005
Posts: 11
Location: Bangalore

PostPosted: Fri Jul 22, 2005 11:31 am    Post subject: Some COBOL Interview Questions....
Reply with quote

1)How static calls nda dynamic call works when changes are made both in
main and sub programs?
2)A-9(35) ,B-9(35) is it posible to perform any operations on thes two?
3) A-X(10) ,B-9(5) is it possible to move datea from A to ?
4) There are two files A,B I want 3 output files using these two files?
5)what are organizations modes of KSDS & ESDS?
6)Different t upes of REAS statements?


Thanks in advance
Back to top
View user's profile Send private message

thanooz

New User


Joined: 28 Jun 2005
Posts: 99

PostPosted: Fri Jul 22, 2005 3:14 pm    Post subject:
Reply with quote

2) yes it is possible if you set compiler option to 32-bit

3)you can move date a to b it is possible

4)use your cobol logic

5)indexed,sequential








thanooz
Back to top
View user's profile Send private message
shiva_suresh
Warnings : 2

New User


Joined: 05 May 2005
Posts: 11
Location: Bangalore

PostPosted: Fri Jul 22, 2005 3:48 pm    Post subject: Re: plz answer the following questions
Reply with quote

1)Different types of READstatements?
Back to top
View user's profile Send private message
rssomm

New User


Joined: 05 Jun 2005
Posts: 41
Location: Hyderabad

PostPosted: Fri Jul 22, 2005 7:10 pm    Post subject:
Reply with quote

Hi Shiva_suresh,

1) Static Call : If changes made to subroutine both Calling & subroutine should be compiled and if changes made to calling program only calling program should be recompiled.

Dynamic call : In changes made to subroutine no need to recompile calling program and if changes made to calling program only calling program need to recompile.

2) I am afraid it is not possible.

3)Possible, if A contains numeric value.

4)Use IEBGENER or SORT , Concatinate the datasets A and B.

5) & 6) Refer any COBOL book and let us know.

Instead of relying on others for readymade answers, please first put some effort from ur side, if you couldn't get answers then post your query in the forum. This will help u to improve.

Best of luck.

Thank U.
Madhu
Back to top
View user's profile Send private message
thanooz

New User


Joined: 28 Jun 2005
Posts: 99

PostPosted: Fri Jul 22, 2005 8:25 pm    Post subject:
Reply with quote

hi

2) sorry for wrong answer i over look that i have seen i am expected 31

3) it is possible if a contains any value either numeric or alphanumeric





thanooz
Back to top
View user's profile Send private message
neosumit

New User


Joined: 20 May 2005
Posts: 1
Location: Mumbai

PostPosted: Wed Aug 03, 2005 11:50 am    Post subject: Re: Some COBOL Interview Questions....
Reply with quote

Hi All,

In case of

1. Static call : the called subroutine has to be present as a Linklib member which would then be included in the final loadmodule of the main calling program.

2. Dynamic call : the called subroutine resides as a loadmodule member of a loadlib.Hence in case of a dynamic call the two programs are present as 2 different loadlib members.

I hope its clear.

Thanks,
neosumit
Back to top
View user's profile Send private message
shivashunmugam Muthu

Active User


Joined: 22 Jul 2005
Posts: 114
Location: Chennai

PostPosted: Wed Aug 03, 2005 12:33 pm    Post subject: Re: Some COBOL Interview Questions....
Reply with quote

Thanooz,

How cum u r saying that we can move alphanumeric to numeric? explain me please....

If its possible i want to understand.....
Back to top
View user's profile Send private message
thanooz

New User


Joined: 28 Jun 2005
Posts: 99

PostPosted: Wed Aug 03, 2005 11:34 pm    Post subject:
Reply with quote

hI,
sHIVA


01 ZA PIC X(10) VALUE "ABCDEFGHIJ".
01 DA REDEFINES ZA PIC 9(5).
PROCEDURE DIVISION.
MOVE ZA TO DA.
DISPLAY DA.



THE OPUT OF THE ABOVE PROGRAM IS FGHI:

THANK,
THANOOZ.
Back to top
View user's profile Send private message
crrindia

Active User


Joined: 02 Jul 2005
Posts: 124
Location: Gurgaon

PostPosted: Thu Aug 04, 2005 9:33 am    Post subject:
Reply with quote

Hi Shiv and Thannoz,

2) A-X(10) ,B-9(5) is it possible to move datea from A to ?

The answer You have given is not exactly correct in all the situations.

Ans. Data can Move from A to B only when A- X(10) contains only numeric values. also data truncation will be applied.

Bye,
Rathna.

thanooz wrote:
hi

2) sorry for wrong answer i over look that i have seen i am expected 31

3) it is possible if a contains any value either numeric or alphanumeric





thanooz
Back to top
View user's profile Send private message
crrindia

Active User


Joined: 02 Jul 2005
Posts: 124
Location: Gurgaon

PostPosted: Thu Aug 04, 2005 9:37 am    Post subject:
Reply with quote

Hi Thanooz/Shiv,

The one which You have given an ex. is totally mistake. first of all how You move data from Alphabetic to Numeric. Please correct that.

Thanks,
Rathna

thanooz wrote:
hI,
sHIVA


01 ZA PIC X(10) VALUE "ABCDEFGHIJ".
01 DA REDEFINES ZA PIC 9(5).
PROCEDURE DIVISION.
MOVE ZA TO DA.
DISPLAY DA.



THE OPUT OF THE ABOVE PROGRAM IS FGHI:

THANK,
THANOOZ.
Back to top
View user's profile Send private message
thanooz

New User


Joined: 28 Jun 2005
Posts: 99

PostPosted: Fri Aug 05, 2005 8:18 pm    Post subject:
Reply with quote

Hi crrindia

Have you chek it in your system wether it is giving any error.

I have checked that example in my system after words only i posted the answere. If it is giving any error in your system please post me.



Thanks,
thanooz.
Back to top
View user's profile Send private message
rssomm

New User


Joined: 05 Jun 2005
Posts: 41
Location: Hyderabad

PostPosted: Sat Aug 06, 2005 10:05 am    Post subject: Re: Some COBOL Interview Questions....
Reply with quote

I am very sad to see this type of discussion on REDEFINES. What ever the Variable names are used, they refer the same memory area. So It is meaningless to use the COBOL verb MOVE. It has no affect.

Some Conpliers may allow to use MOVE and Some may not. Concept should be understood clealy. It is some thing like a person being refered with 2 names.


Regards
Madhu
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Aug 07, 2005 4:34 am    Post subject:
Reply with quote

Regarding Ques 3. Back to the orig ques:

The key to the solution is the following rule for numeric elementary receiving items:

When the sending item is alphanumeric, the data is moved as if the sending item were described as an unsigned integer.

So, if A pic X(10) [value 'ABCDEFGHIJ'] is moved to B pic 9(05) the result in B is 'FGHIJ'.

That agrees with what THANOOZ wrote (almost).

BTW, if B was defined as B pic 9(05)v99, the result would be 'FGHIJ00'.
Back to top
View user's profile Send private message
rssomm

New User


Joined: 05 Jun 2005
Posts: 41
Location: Hyderabad

PostPosted: Sun Aug 07, 2005 8:35 am    Post subject:
Reply with quote

hi Jack

Quote:
BTW, if B was defined as B pic 9(05)v99, the result would be 'FGHIJ00'.


I am afraid the answer is not correct. Where from we get zeros in last 2 positions?

Regards
Madhu
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts Viewing executing process in NDM .. q... Debb.Brant IBM Tools 0 Wed Dec 14, 2016 10:55 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us