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

How many maximum number of procedures can we write in one COBOL program?

5 Answers  


What do you feel makes a good program?

2 Answers  


what is filler and what is use of filler

3 Answers   Syntel,


which is faster either static call or dynamic call ? and specify the reasons for it ? reply fast

1 Answers  


How to get the last record in vsam file in cluster? And how can you get the kids file records into your cobol program?

0 Answers  






What is the Importance of GLOBAL clause According to new standards of COBOL?

2 Answers   Infosys,


explain sorting techniques in cobol program?

0 Answers  


study the data discriptions and answer the questions given below i)01 ORDER RECORD 05 OUT-HEADER PIC X(50) 05 ITEM-COUNT PIC 99 05 OUT-ITEM PIC X(20) OCCURS 1 TO 20 DEPENDING ON ITEM-COUNT ii)01 NAME-AND-ADDRESS 05 N-AND-A-LINE OCCURES 5 05 LINE-LENGTH PIC P9 05 N-AND-A-CHAR PIC X OCCURS 1 TO 20 DEPENDING ON LINE-LENGTH iii)01 SALES-LIST 05 SALESMAN-COUNT PIC 99 05 SALES PIC 9(6) OCCURS 1 TO 100 DEPENDING ON SALESMAN-COUNT iv)01 ORDER-RECORD 05 NO-OF-BRANDS PIC 99 05 BRAND-PURCHASED OCCURS 1 TO 15 DEPENDING ON NO-OF-BRANDS which of the following is true? a.i) and iii) are valid b.i) and iv) are valid c.i) and iii) are not valid d.all are valid

4 Answers   TCS,


Which division and paragraphs are mandatory for a COBOL program?

0 Answers  


2)Where the Plan is located in CICS-DB2?

1 Answers   IBM,


Give some advantages of REDEFINES clause?

2 Answers   Syntel,


How to replace the GOTO statement in COBOL without changing the structure of program. e.g. consider following code... I.D. E.D. D.D. P.D. compute C = A + B. GOTO para 100-display. compute D = C - D. GOTO 200-display. some other logic...... ........ GOTO 300-para. ...... ...... GOTO 400-para. Now I want to replacce all GOTO statements without changing the structure and otput of program.

6 Answers   Accenture,


Categories