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 are literals?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
What is the difference between goback, stop run and exit program in cobol?
can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there
Write the code implementing the perform … varying.
How do you define a variable of comp-1 and comp-2?
Which division and paragraphs are mandatory for a COBOL program?
In COBOL programming, what is PERFORM? What is VARYING?
What happens when we move a comp-3 field to an edited (say z (9). Zz-)?
How many bytes S(8) comp field occupy and its maximum value?
Write a program to enter and display the names of students in a class using the occurs clause.
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...)
How you can read the file from bottom?
What is static and dynamic call in cobol?
how do you reference the variable block file formats from cobol programs