How To move a value to an array using move verb?
Answers were Sorted based on User's Feedback
one correction in Jagan's answer..
MOVE 1 to A(I)
we should not use [] for array in cobol.
Is This Answer Correct ? | 12 Yes | 0 No |
Answer / jagan
using PERFORM statements we can move a value to an array
using the MOVE verb.
Below is an example of In-Line Perform where we are moving
a value to an array A
01 Array
05 A PIC X(10) occurs 10 times.
PERFORM VARYING i from 1 by 1 until i > 10
MOVE 1 TO A[I]
END-PERFORM
Is This Answer Correct ? | 14 Yes | 3 No |
Answer / r
In continuation with first answer below code need to be
added in
01 Array
05 A PIC X(10) occurs 10 times.
CODE: 01 ARRAY
05 A PIC X(10) OCCURS 10 TIMES INDEXED BY I.
Is This Answer Correct ? | 0 Yes | 1 No |
what do you mean by copybook? and what is the difference between the copybook which we are using in working storage and procedure division.
i want all ERRORS codes in COBOL ,JCL,VSAM ,DB2,CICS
Is this allowed? 01 WS-TABLE. 03 FILLER-X PIC X(5) VALUE 'AAAAA'. 03 WS-EX REDEFINES FILLER-X OCCURS 5 TIMES PIC X(1). can redefines clause be used with occurs clause?
What are ISOLATION LEVELS? Where do we need to specify them in compiling JCL (Exactly which statement and what is syntax for it)?
How many times the loop runs here 01 a pic 9(2) value 10. perform para1 a times stop run. para1: move 20 to a.
How are the next sentence and continue different from each other?
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?
wirte a pgm in using files in which we hav 10 ,20,30 40...100 records in inputfile and i want them to be send to outputfile in reverse order. PLZ HELP ME OUT .........THIS IS A RECENT QUESTION IN IGATE..
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.....
1.What is the default print format in cobol?
i have mainprogram and subgram...if i compile mainprogram without stop run..what will u get in compilation time?
What are the different rules to perform a Search?