01 a pic s9(5) value '-12345' how it will be stored

Answers were Sorted based on User's Feedback



01 a pic s9(5) value '-12345' how it will be stored..

Answer / ajay

X'F1F2F3F4D5'

Is This Answer Correct ?    10 Yes 4 No

01 a pic s9(5) value '-12345' how it will be stored..

Answer / nagaraj ramammorthy

here the usage clause is DISPLAY which is default. so each
digit takes one byte to store and the sign is punched with
the last digit..

so it will be stored as 1234N.

note:
numbers punched with '+' sign
0 - {
1 - A
2 - B
3 - C
4 - D
5 - E
6 - F
7 - G
8 - H
9 - I


numbers punched with '-' sign
0 - }
1 - J
2 - K
3 - L
4 - M
5 - N
6 - O
7 - P
8 - Q
9 - R

hope this is clear

Is This Answer Correct ?    6 Yes 1 No

01 a pic s9(5) value '-12345' how it will be stored..

Answer / shekhar

as from -1 to -9 uses from j to r....
and signed trailing is default...
so the ans is 1234n....

Is This Answer Correct ?    4 Yes 0 No

01 a pic s9(5) value '-12345' how it will be stored..

Answer / nataraj

-12345

Is This Answer Correct ?    11 Yes 8 No

01 a pic s9(5) value '-12345' how it will be stored..

Answer / sachin

I think from -1 to -9 uses the letter
J to onward

and for +1 to +9
uses the A to H

Is This Answer Correct ?    3 Yes 1 No

01 a pic s9(5) value '-12345' how it will be stored..

Answer / gopal chand

01 a pic s9(5) value '-12345' how it will be stored

It will be stored :
1234u

In data files Negative Values are Stored as per the
following manner

0-p 1-q 2-r 3-s 4-t 5-u 6-v 7-w 8-x 9-y

The Last Digit of the No. is stored like this in the
following example.

Example: 01 a pic s9(4)v99

move -3456.23 to a.
display a.
Output is : 34562s

Is This Answer Correct ?    1 Yes 0 No

01 a pic s9(5) value '-12345' how it will be stored..

Answer / dave

I have verified the Nagaraj Ramammorthy's answer this seems
to be correct...

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

How to traceback if I am getting SOC7 or SOC4 abend? List down the steps

0 Answers  


What compiler option would you use for dynamic linking?

2 Answers  


What is the size of s9(19)comp3? explain

8 Answers  


I have a variable account-number declared as comp-3, s9(10) comp-3 in a file. How do i find a particular account number say 123456 in that file?

3 Answers  


I have a source program compiled with Cobol-2. The output file has a record length of 100 defined in the program but a record of 60 bytes getting written into it. i.e. The rest of 40 bytes I am not Writing anything. But it by default puts some values into the last 40 bytes. However it does not impact anything. But when Compiled the module with Enterprise Cobol the last 40 bytes were spaces as fillers. Can anyone explain?

5 Answers   Cognizant,






What will happen if we move SPACES to numeric field and ZEROES to alphabetic field?

2 Answers  


what is the advantage of sync class

3 Answers   ACS,


How can you get the ksds file records into your cobol program?

0 Answers  


How do you differentiate between cobol and cobol-ii?

0 Answers  


What are different file OPEN modes available in COBOL?

4 Answers   Sun Life,


HOW WE WILL SORT THE ARRAY WHICH IS GOING TO USE FOR SEARCH ALL?

2 Answers   Cap Gemini,


Can JUSTIFIED be used for all the data types?

3 Answers  


Categories