01 a pic s9(5) value -12345,
if we disply a , the sign will overpunched with last digit
but i need to get the miuns sign in the result?

Answer Posted / david

you will need two variables. Variable A where you put your
computation and variable B which will be displayed:

01 a pic s9(5) value -12345.
01 b pic -9(5).
or 01 b pic -zzzz9.
or 01 b pic 99999-.
or 01 b pic z(5)-.
or 01 b pic ----9.

MOVE A TO B.
DISPLAY B.

Is This Answer Correct ?    7 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are literals?

632


What are the different data types in cobol?

797


if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need

857


What is inspect in cobol ?

803


Which mode is used to operate the sequential file?

669






What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?

717


Define cobol?

862


State the various causes of s0c1, s0c5 and s0c7.

665


What is the difference between Global and External Variables?

666


Write some characteristics of cobol as means of business language.

619


Write down the divisions of cobol program?

671


I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.

1116


What is the Purpose of POINTER Phrase in STRING command in COBOL?

721


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.

5693


What is the use of intialize verb?

750