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
Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?
HOw can I get the negative sign while deduct high value from low value
What are all the divisions of a COBOL program?
Explain how to differentiate call by context by comparing it to other calls?
What the difference is between continue and next sentence?
i need a small 3d program using inline and outline.
Can you please let me know the centre name of INS certification in Kolkata.
What is amode(24)?
What is Pic 9v99 Indicates in COBOL?
Name the divisions, which are available in a cobol program?
What is the Purpose of POINTER Phrase in STRING command in COBOL?
) How do u handle errors in BMS macro?
Have you used the sort in your project?for this type of questions any working on real time project give the eg. with real time scenario.
How to read the 2nd last record of a VSAM file? (The file size is huge and we don't know the key)
What is the usage of comp fields in cobol?