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 / mr.perfect

01 A pic s9(5) value -12345
01 B pic +9(5)
PROCEDURE DIVISION
MOVE A TO B
DISPLAY B
STOP RUN

o/P:
-12345

Will this work?

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you define a variable of comp-1 and comp-2?

691


Are you comfortable in cobol or jcl?

633


Why is it necessary that file needs to be opened in I-O mode for REWRITE?

735


How you can read the file from bottom?

652


How many sections are there in data division in COBOL?

673






i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com

1757


INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?

405


What is perform what is varying?

694


Write a cobol program making use of the redefine clause.

720


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

705


What is link edit in cobol?

729


what is difference between cobol and cobol/400

21546


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

648


What is the difference between PIC 9.99 and 9v99 in COBOL?

726


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

672