HELLO FRIENDS,

THIS IS JANARDHAN.GADIRAJU, I FACED ONE INTERESTING
QUESTION IN COBOL, THAT IS WHAT ARE THE VALUES WE CAN SEE
IN HIGHVALUES AND LOWVALUES, CAN U PLEASE GIVE ME THE ANSWER

Answers were Sorted based on User's Feedback



HELLO FRIENDS, THIS IS JANARDHAN.GADIRAJU, I FACED ONE INTERESTING QUESTION IN COBOL, THAT IS W..

Answer / nihar ranjan karan

I completely agree with Nikhil...
To add up a few more points which will be of help.....

Open up a dataset and put HEX ON , you will see the
following results assuming the variable occupies 4 bytes of
space:

low values 00000
00000

high values FFFF
FFFF

spaces 4444
0000

display item numbers FFFFFFFFFF
0123456789

characters A - Z will be of the following form:
C1-C9 will represent A-I,D1-D9 will represent J-R,E2-E9
will represent S-Z

comp-3 ...for example if number is positive 5893.
0083
059C

for negative last character will be D.

For comp it is converted into its hexadecimal equivalent.

Is This Answer Correct ?    7 Yes 0 No

HELLO FRIENDS, THIS IS JANARDHAN.GADIRAJU, I FACED ONE INTERESTING QUESTION IN COBOL, THAT IS W..

Answer / jeena.mj

You cannot move LOW-VALUES or HIGH-VALUES to a "PIC 9"
field.

if we move low value and high values to alpha or
alphanumeric field the low value and high values are
x'0000' and x'FFFF'

Is This Answer Correct ?    5 Yes 1 No

HELLO FRIENDS, THIS IS JANARDHAN.GADIRAJU, I FACED ONE INTERESTING QUESTION IN COBOL, THAT IS W..

Answer / nikhil

answer 2 is misleading. First of all you cannot use these
figurative constants for numeric variables.Second the first
answer gives the correct value. Please do not post anything
without confirming. Our aim is to provide correct answers.

Is This Answer Correct ?    3 Yes 0 No

HELLO FRIENDS, THIS IS JANARDHAN.GADIRAJU, I FACED ONE INTERESTING QUESTION IN COBOL, THAT IS W..

Answer / jack

What to check for alphanumeric fields

Move spaces to low-values
Move 'zzzzzzzz' to high-values.

Is This Answer Correct ?    1 Yes 0 No

HELLO FRIENDS, THIS IS JANARDHAN.GADIRAJU, I FACED ONE INTERESTING QUESTION IN COBOL, THAT IS W..

Answer / sejacoemor

I agree with Nikhil that our aim is to provide correct answers.

For Answer #4 (Nihar Ranjan Karan)

to compute for number of bytes for COMP-3:
count the total number of digits, divide it by 2 (disregard any fraction) then add 1. So, in the example if number is positive 5893.
it will be stored in 3 bytes only (not 4)
083
59C

---------------------------------------------

For Answer #5 (which actually a question from Prasenjit_in)

moving LOW-VALUES to a KEY-FIELD will point to 1st record while moving HIGH-VALUES to KEY-FIELD points to last record.

Is This Answer Correct ?    1 Yes 0 No

HELLO FRIENDS, THIS IS JANARDHAN.GADIRAJU, I FACED ONE INTERESTING QUESTION IN COBOL, THAT IS W..

Answer / prasenjit_in

HI all related to high values i also faced a sort of similar
question....The question was if we move high values to a
record structure of a file and then read it what will the
o/p show.will it show the last record in the file.

Is This Answer Correct ?    0 Yes 0 No

HELLO FRIENDS, THIS IS JANARDHAN.GADIRAJU, I FACED ONE INTERESTING QUESTION IN COBOL, THAT IS W..

Answer / necron

if the field is an alphabetic or alphanumeric you will have
spaces and if it is numeric you will have zeroes..(for low-
values)...i dont know abt high values! ;-)

Is This Answer Correct ?    1 Yes 11 No

Post New Answer

More COBOL Interview Questions

How can we find out wether to declare the data items like Integer, Char,Comp? If comp types how can we decide wether it is Comp and Comp3.How it is? Please Explain... Cheers.

1 Answers   Syntel,


wht is load module and object module ?

2 Answers   DELL, TCS,


What is Pic 9v99 Indicates in COBOL?

0 Answers   SwanSoft Technologies,


How can i write a comp-3 variable into a sequential file should i declara the field in the file description as comp- 3?

1 Answers  


hi, can you ppl tell me, how to check whether the rewrite we gave for the ksds file is successful or not in the program.? i gave rewrite, the rewrite code is executing and maxcc=0 but updation doenot happen in the file?

1 Answers   CGI,






How do you get the data to code the BMS macro?

0 Answers   IBM,


What is the difference between COMP & COMP-3 ?

2 Answers  


How many sections are there in data division in COBOL?

0 Answers   B-Ways TecnoSoft,


If i have a variable A pic 9(2) value 10 Compute A = a - 100 what will be the value of A and will there be any error becoz of the Negative value

3 Answers   CTS,


level number 77 is used to define a)group data b)elementary data c)redefine d)none

8 Answers   TCS,


sample code for read a 2nd record from last in flatfile how can do?

4 Answers   iNautix,


Which of the following EDITind and PICTURE symbols is to be used if a minus(-) is to appear before the value if the value is -ve and a plus(+) is to appear before the value if the value is +ve? (a) + (b) - (c) + OR (d) It is not possible

7 Answers   TCS,


Categories