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

Suppose a program has the following code. What will be the output? MAIN-PARA. DISPLAY 'MAIN-PARA' PERFORM SECTION-A. STOP RUN. SECTION-A. PARA-A1. DISPLAY 'SECTION A PARA A1'. PARA-A2. DISPLAY 'SECTION A PARA A2'.

4 Answers  


What is Static,Dynamic linking ?

2 Answers  


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

4 Answers   Infosys,


plz,could any one tell me? what about EBCDIC in cobol?briefly?

1 Answers  


If i got a job on mainframe technology, will i have a bright future?. Some people are discouraging me. Let me know, is it true? Please bring back me from the confusion.

2 Answers  


What is the different between index and subscript?

3 Answers  


we can use set true for condition names.. similarly can we code set to false in cobol pgm? will it work?

1 Answers  


Under which scenario you would go for a static call as opposed to dynamic call?

5 Answers   TCS,


How to traceback if I am getting SOC7 or SOC4 abend? List down the steps

0 Answers  


I have sequential file recl 1000 i want to add another 15 bytes to it. The record length should not change..How?

1 Answers   CTS, HCL,


u have passed sme charecters thru parm parameter in jcl. how do u code in cobol to recieve the values u gave in parm ?

2 Answers   IBM,


In a COBOL program, 2 tables TABLE1 and TABLE2 are defined that are indexed by INDEX1 and INDEX2 respectively. Can we use INDEX1 with TABLE2 and INDEX2 with TABLE1?

1 Answers  


Categories