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

can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

1908


What is perform what is varying?

711


What is rmode(any) ?

686


How can i load all the data from a file to Table (array) in cobol.How i manage the occurs clause with out reading the file.Any options avilable ? Please can any one help me it is urgent?

2099


How do you code cobol to access a parameter that has been defined in jcl? And do you code the parm parameter on the exec line in jcl?

700






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

717


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

2661


What is a SSRANGE and NOSSRANGE?

823


What is amode(31)

724


Name some of the examples of COBOl 11?

2686


how do you reference the rrds file formats from cobol programs

801


Are you comfortable in cobol or jcl?

643


What is a report item?

741


How do you reference the following file formats from cobol programs?

695


What are different data types in cobol?

691