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

COBOL Interview Questions


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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: 1448
Location: Chicago, IL

PostPosted: Thu Jun 16, 2005 6:12 pm
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
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
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
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
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 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