Suppose i have a variable with s9(18)v99 comp3 . what is the size of variable . If s9(18) comp3 is 10 bytes . There should be some difference between two allocations ?


Thanks
krishna chaitanya

Answers were Sorted based on User's Feedback



Suppose i have a variable with s9(18)v99 comp3 . what is the size of variable . If s9(18) comp3 is 1..

Answer / abi

ID DIVISION.
PROGRAM-ID. PA.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
*01 B PIC X(20) VALUE ALL '1'.
01 A PIC S9(18)V99 COMP-3.
PROCEDURE DIVISION.
MAIN-PARA.
MOVE 1111111111111111111 TO A.
DISPLAY A.
STOP RUN.
********************** Bottom of Dat
when we are executed this program we got it following
discription.

*More than 18 digit positions were specified in
a "PICTUURE" string for a numeric or numeric edited item.
A "PICTURE" string of "S9(18)" was assumed
.
* Numeric literal "1111111111111111111" was longer than
than the maximum allowed length. The literal was truncated
to "111111111111111111".

Is This Answer Correct ?    6 Yes 4 No

Suppose i have a variable with s9(18)v99 comp3 . what is the size of variable . If s9(18) comp3 is 1..

Answer / chaitu215

Memory related

Is This Answer Correct ?    5 Yes 5 No

Post New Answer

More COBOL Interview Questions

if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.

2 Answers   IBM, Steria,


What is SDSF?

13 Answers   IBM,


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

0 Answers  


where will u code file status ?

2 Answers   TCS,


In COBOL programming, what is PERFORM? What is VARYING?

0 Answers   CDC,






What is the purpose of Identification Division?

1 Answers  


whats the disadvantage of search all over search?

4 Answers   Patni, TCS,


) How do you access the migrate the data from production region to development region

1 Answers   IBM,


88 class is used for

5 Answers   CTS, EDS,


How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?

0 Answers  


why 02 level number can't be use as a separate level number like 01 or 77 ?

3 Answers  


Explain how to differentiate call by context by comparing it to other calls?

0 Answers  


Categories