can we display comp-3 variables. if we want to display what
we have to do . give me one example

Answers were Sorted based on User's Feedback



can we display comp-3 variables. if we want to display what we have to do . give me one example..

Answer / craig

You can display them, but they will appear non-numeric.
Move the field to a WS field defined as pic +9('number of
digits') and display the WS field to make the data user-
friendly.

Is This Answer Correct ?    22 Yes 4 No

can we display comp-3 variables. if we want to display what we have to do . give me one example..

Answer / vivekananda

We can't display COMP-3 directly so we have to move the value into another variable, check this given example.

01 A1 PIC S9(4) COMP-3 VALUE 1234.
01 A1-NUM PIC S9(4) VALUE ZEROES.
01 B1 PIC X(4).

MOVE A1 TO A1-NUM.
MOVE A1-NUM TO B1.
DISPLAY B1.

Is This Answer Correct ?    25 Yes 7 No

can we display comp-3 variables. if we want to display what we have to do . give me one example..

Answer / narayana g

You can display the COMP-3 variable by redefining to numeric
variable.

Is This Answer Correct ?    16 Yes 2 No

can we display comp-3 variables. if we want to display what we have to do . give me one example..

Answer / antony

We will get the actual value of the variable, so we need to
either redefine or move that to an equivalent numeric
variable to display it.

Is This Answer Correct ?    9 Yes 1 No

can we display comp-3 variables. if we want to display what we have to do . give me one example..

Answer / munna

yes we can display with normal display command

Is This Answer Correct ?    8 Yes 20 No

can we display comp-3 variables. if we want to display what we have to do . give me one example..

Answer / kanika

yes using Display command

Is This Answer Correct ?    7 Yes 34 No

Post New Answer

More COBOL Interview Questions

can we read in input the file with a variable length ? please , how ..could you help me ?

3 Answers   EDS,


Consider the following: 77 A PIC 9(10) 77 B PIC 9(10) 77 C PIC 9(19) MULTIPLY AB BY B GIVING C Which of the following is true ? (a) The execution of the above may result in size error. (b) The execution of the above will result in size error. (c) The definition of C is invalid resulting in compilation error. (d) No error will be thee and the program would proceed correctly.

4 Answers   TCS,


what is search and searchall?what is the diffrence between them?give an best example?

3 Answers   BirlaSoft,


I have the file which is having the extension no as records. sample file will look like below. 2310 3410 3256 4350 3781 5408 I need to replace the record which is starting with 3 to 5 (i.e) 3410 to 5410. How can we do it through cobol and cobol-db2 program? I need the possible logic?

5 Answers   RBS,


how will u pass dadta to cobol+db2 program...?

4 Answers   IBM,


01 a pic x(4) value 'abcd' 01 b pic 9(3) can we move from a to b.if possible what would be stored in b.

15 Answers   ACS,


a. Can the OPTIONAL clause in COBOL only be coded for input files? b. If it is coded for files opened in OUTPUT, I-O or EXTEND mode, will it give a compilation error? c. If there are no compilation errors and if such files are not coded in the JCL, will the OPEN statement run fine when these files are opened? d. How will a WRITE statement work for the above files?

2 Answers  


What is the difference between subscript and index?

1 Answers  


how do you reference the variable unblock file formats from cobol programs

0 Answers  


Can we call a CICS program from a batch program or viceversa?If so, how?

3 Answers  


How many bytes S(8) comp field occupy and its maximum value?

0 Answers  


give the examples of strings in cobol

1 Answers   IBM,


Categories