How To move a value to an array using move verb?

Answers were Sorted based on User's Feedback



How To move a value to an array using move verb?..

Answer / suresh ramaiyan

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

How To move a value to an array using move verb?..

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

How To move a value to an array using move verb?..

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

Post New Answer

More COBOL Interview Questions

what do you mean by copybook? and what is the difference between the copybook which we are using in working storage and procedure division.

3 Answers   HCL, TCS,


i want all ERRORS codes in COBOL ,JCL,VSAM ,DB2,CICS

4 Answers   Infosys,


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?

4 Answers  


What are ISOLATION LEVELS? Where do we need to specify them in compiling JCL (Exactly which statement and what is syntax for it)?

2 Answers   T systems,


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.

3 Answers  


How are the next sentence and continue different from each other?

0 Answers  


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?

4 Answers   CSC, TCS,


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..

5 Answers   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.....

3 Answers   IBM,


1.What is the default print format in cobol?

5 Answers   HSBC,


i have mainprogram and subgram...if i compile mainprogram without stop run..what will u get in compilation time?

1 Answers   HCL,


What are the different rules to perform a Search?

0 Answers  


Categories