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 |
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'.
What is Static,Dynamic linking ?
i want all ERRORS codes in COBOL ,JCL,VSAM ,DB2,CICS
plz,could any one tell me? what about EBCDIC in cobol?briefly?
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.
What is the different between index and subscript?
we can use set true for condition names.. similarly can we code set to false in cobol pgm? will it work?
Under which scenario you would go for a static call as opposed to dynamic call?
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
I have sequential file recl 1000 i want to add another 15 bytes to it. The record length should not change..How?
u have passed sme charecters thru parm parameter in jcl. how do u code in cobol to recieve the values u gave in parm ?
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?