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
 

 

COBOL Interview Questions

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

New User


Joined: 11 Jun 2005
Posts: 24

PostPosted: Thu Jun 16, 2005 5:21 pm    Post subject: COBOL Interview Questions
Reply with quote

Hi,

Please let me know the answers and explanations of the
following 3 questions:

a)The smallest negative dollar amount with a dollar in the output that can be edited Through the picture string -$$$$ is

1) ?1000
2) ?9999
3) ?999
4) ?100


b)The DATA DIVISION Entries are

01 REC-1.
02 A PIC 9(4)V99 VALUE 4567.50
02 B PIC 99V9 VALUE 45.2.
01 REC-2.
02 C PIC ZZZ9.99
02 D PIC 99.99.

What will be the content in REC2 after the execution of MOVE REC-1 TO REC-2.


c)IF NOT AGE LESS THAN 30 AND 40
GO TO PARA-AGE-MIDDLES.
The controls will go to the paragraph named PARA-AGE-
MIDDLE.

(a) if AGE is greater than or equal to 40.
(b) If AGE is greater than or equal to 30.
(c) If AGE is greater than or equal to 30 but less than 40
(d) If AGE is less than or equal to 30.



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

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Thu Jun 16, 2005 6:12 pm    Post subject: Re: COBOL Interview Questions
Reply with quote

a) First

4) ?100

b) Second

456750452

c) Third

(a) if AGE is greater than or equal to 40.
Back to top
View user's profile Send private message
vrexy

New User


Joined: 19 May 2005
Posts: 7
Location: bangalore

PostPosted: Thu Jun 23, 2005 2:27 pm    Post subject: which is smallest??
Reply with quote

Hi,

which one z smallest?? -1 or -2 ???? I thought -9999 z right answer for first query.

cheers,
rexy.
Back to top
View user's profile Send private message
donevin

New User


Joined: 07 Jun 2005
Posts: 70
Location: South Africa

PostPosted: Fri Jul 15, 2005 2:45 pm    Post subject: Re: COBOL Interview Questions
Reply with quote

There is more to the second question than meets the eye. First, remember you are moving a 9 character alphanumeric field (REC-1) to a 12 character alphanumeric field (REC-2). Therefore REC-2 will be 456750452 followed by three spaces. This is because in REC-1 the decimal point is implied and doesn't take up any space, whereas in REC-2 the decimal points are seen as characters in the alphanumeric item REC-2. So, the 2 decimal points plus the two field sizes gives us a total of 12 characters and since the receiving field is alphanumeric and bigger than the sending field the data in the receiving field is padded on the right hand side with spaces. But even before this, for the code to compile there must be a full stop after the value of field A.
Back to top
View user's profile Send private message
gsnvsr

New User


Joined: 06 Jul 2005
Posts: 40

PostPosted: Fri Jul 15, 2005 5:40 pm    Post subject: Re: COBOL Interview Questions
Reply with quote

For the first question, I believe -9999 is the correct answer..

Best regards,
prasad
Back to top
View user's profile Send private message
rssomm

New User


Joined: 05 Jun 2005
Posts: 41
Location: Hyderabad

PostPosted: Fri Jul 15, 2005 9:14 pm    Post subject:
Reply with quote

Please find answers below.

a)-999
b) 456750452BBB where B stands for Blank
c)The question can be interpreted as If Age not less than 30 and Age less than 40. So the answer would be C i.e If AGE is greater than or equal to 30 but less than 40.


Thank You.
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
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
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


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