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

Some COBOL Interview Questions....


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top