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

Answer Posted / 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 ?    24 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write down the divisions of cobol program?

665


I have program P1 which calls file F1 which has 100 records and following structure 001 .................. 002 .................. 003 .................. 098 .................... 099 ................... 100 .................... Now I want to read these files and write these records in file F2 in following manner. 001 ...... 051 ..... 002 ...... 052 ..... 003 ...... 053 ..... .......... ....... .......... ....... .......... ....... 048 ........ 098 ...... 049 .......... 099 ....... 050 .... 100 ......

10569


Explain the configuration section of a cobol program with examples of syntax.

653


A table has two indexes defined. Which one will be used by the SEARCH?

752


Describe the cobol database components?

674






input= ,,,, mainframe training ,,, hyderabad .... location.... output1=$ mainframe training in hyderabad location$ output2=**** mainframe training in hyderabad location ****. In this pgn when we give input considering the spaces the output is displayed in this format.Like in the place of ,,,, $ should be displayed likewise.So please helpmeout.

1774


how to move the records from file to array table. give with code example

2214


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

1626


How to use the same COBOL program in Batch and CICS on lines? explain with an example

1912


Write a program to enter and display the names of students in a class using the occurs clause.

647


what is s000 u4087 error? please give the all error codes in cobol,jcl.

17024


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

730


What is the difference between perform … with test after and perform … with test before?

875


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

674


What is the default value(s) for an initialize and what keyword allows for an override of the default?

691