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
I have a File that has duplicate records. I need only those records that occur more than thrice.?
For rewrite, why is it mandatory that file needs to be opened?
INREC AND OUTREC? HOW TO SPLIT 5K RECORDS TO DIFFERENT FILES IN A FILE IN COBOL? RESTART IN COBOL-DB2? ISOLATION LEVELS?
What are literals?
I need to compare 3 variables(dates) and do some processing based on the earliest date. There could be more then 1 date record in any of the 3 fields. What is the best way to code this?
What is amode(24)?
Describe the cobol database components?
What is the difference between comp and comp-3 usage?
how do you reference the variable unblock file formats from cobol programs
What are the different open modes available in cobol?
What type of SDLC u followed? Why?
What is a report item?
What is link edit in cobol?
Explain the configuration section of a cobol program with examples of syntax.
What are the different rules of SORT operation?