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 is the reference modification.
What is the difference between external and global variables in COBOL?
Why occurs can not be used in 01 level ?
level number 77 is used to define a)group data b)elementary data c)redefine d)none
where did you see the information regarding abend codes in jcl?
what is s000 u4087 error? please give the all error codes in cobol,jcl.
if a pic 9(3) value 354,b pic x(2) value '46' then a)a>b 2)a<b 3)error
what is label record is standard or omitted in file description of data division?
How to read the last 100 records from a COBOL file. The file contains N number of records.
Scenario: I have 3 Input Files.Read the first i/p file and depending on certain business logic, I want to read wither i/p file-2 or i/p file-3.Now, depending on certain business logic applied to the record read from either file-2 or file-3, I decide to write them to either output file-2 or output file-2. Question: How many job steps are necessary to implement a solution for the above.
Why we are using comp and comp-3 in real time projects?
Can we dynamically increase the size of occurs clause? i.e In case I an not sure of the size of array and want to increase the size at run time.If yes , how?