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
What is the difference between a binary search and a sequential search? What are the pertinent cobol commands?
Name the divisions, which are available in a cobol program?
What is amode(24)?
how to refer the data field?
I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?
how do you reference the fixed unblock file formats from cobol programs
How are the next sentence and continue different from each other?
please..could u give an example about USAGE IS POINTER ..and explain why and when we use it ?
What is the Purpose of POINTER Phrase in STRING command in COBOL?
A table has two indexes defined. Which one will be used by the SEARCH?
What is the LINKAGE SECTION used in COBOL?
Define static linking and dynamic linking.
What the difference is between continue and next sentence?
When is inspect verb is used in cobol?
What is the Purpose of Pointer in the string?