How to define variable 9(20) in COBOL, because compiler
does not allow us to declare variables with Pic 9(18). Can
anyone please let me know the answer... I know one answer
to this question which is to use Compiler option Arith
(Extend) during Compilation. It extends the maximum limit
to 9(32)..Just wanted to know if there is any other way to
extend this?

Answer Posted / dimpy19

try with this:

01 VARIABLE-ABC.
03 VAR-1 PIC 9(18).
03 VAR-2 PIC 9(2).




or
use PROCESS ARITH(EXTEND) before IDENTIFICATION DIVISION

ARITH option syntax

.-COMPAT-.
>>-ARITH(-+-EXTEND-+-)-----------------------------------------><


When you specify ARITH(EXTEND):
The maximum number of digit positions that you can specify in the PICTURE clause for packed-decimal, external-decimal, and numeric-edited data items is raised from 18 to 31.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can we find that module can be called – whether DYNAMICALLY or STATICALLY?

694


How can you get the ksds file records into your cobol program?

631


What are different data types in cobol?

669


If you are current on the owner of a set, what is the difference between obtain next and obtain first?

628


how can we apply for HSBC exam(Mainframe) in India??? i went to their site and was told to submit my CV ,. etc..( totally confusing...)

1911






What is the Purpose of Pointer in the string?

630


When is inspect verb is used in cobol?

661


How arrays can be defined in COBOL?

649


Can we redefine the field of x(200) to less than 200?

803


What is amode(24), amode(31), rmode(24) and rmode(any) (applicable to only mvsesa enterprise server) ?

658


What are the different rules of SORT operation?

684


what is difference between cobol and cobol/400

21530


how do you define single dimensional array and multidimensional array in your cobol?

657


If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly

2647


What is amode(24)?

671