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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between structured cobol programming and object alternativelyiented cobol?

751


What is the Purpose of Pointer in the string?

641


Write the code implementing the perform … varying.

639


What is amode(24)?

680


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

639






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

688


i made it to stage 3 of an interview process wednessday they will quiz my knowledge again face to face for an analyst role recruiter said it will be based on Business requirements system is cobol and good ideas what they might ask etc

2101


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

677


What are the different rules to perform a Search?

613


Explain what you understand by passing by value.

692


i want a program using by if, evaluate , string, unstring, perform, occurs?

4046


What is static and dynamic call in cobol?

590


Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?

624


What is inspect in cobol ?

797


How do you reference the following file formats from cobol programs?

693