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?
Answers were Sorted based on User's Feedback
Answer / abc
try with this:
01 VARIABLE-ABC.
03 VAR-1 PIC 9(18).
03 VAR-2 PIC 9(2).
This may work, please try and see.
| Is This Answer Correct ? | 10 Yes | 1 No |
Answer / vikram
01 VAR-1 PIC 9(18).
change the datatype then it's possible
01 VAR-1 PIC x(20).
| Is This Answer Correct ? | 1 Yes | 0 No |
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 |
Answer / sachin borase
Use the varchar.
01 var-char-variable.
49 ws-letch s9(4) comp.
49 ws-text 9(20).
| Is This Answer Correct ? | 2 Yes | 9 No |
Write the code to count the sum of n natural numbers.
01 var1 pic x(10) 01 var2 redefines var1 pic 9(10). then in procedure division move 'abcde' to var1 then waht is the value of var1 and var2
Can we put move statement in COBOL copybook
What is the difference between perform … with test after and perform … with test before?
What happens in the background of spool when we submit a job for compilation and execution... This is a recent question in ibm...Kindly help me.....
how many bytes does s9(15) occupy in comp1 comp2 and comp3 ?
what is the difference between PA & PF keys?
How to retrive the 9th records out of ten records using the cobol program ?
if a>b continue display x. dispaly y. end-if display 1 display 2. display 3. what should be my output ?
Why there is no questions in this column?
A cobol program to read a file , match it with other if. If match occurs then write it to an output file. If no match then no need to write it.Error log created by program to track any error.
WE HAVE 5 DIFFERENT RECORDING MODE IN COBOL.FIXED, FIXEDBLOCK, VARIABLE, VARIABLEBLOCK AND UNDEFINED. WHAT IS THE DIFFERENCE AMONG ALL AND WHICH TYPE OF FORMAT SHOULD BE USED WHEN