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 / chandrababu naidu

01 ARRAY.
02 ARRAY2 PIC 99 OCCURS 5 TIMES INDEXED BY I.
PROCEDURE DIVISION.
MOVE LOW-ELEMENT TO ARRAY2 [ I ].
or
MOVE HIGH-ELEMENT TO ARRAY.

Is This Answer Correct ?    1 Yes 0 No

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

Answer / srinivas yadav

MOVE VARIABLE TO ARRAY-ELEMENT.
EX: MOVE A TO WS-ARRAY.

Is This Answer Correct ?    1 Yes 1 No

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

Answer / pak

move VALUE to array_name(index/subscript)

where VALUE is the data to be input in array.
if the array is indexed use,index or else subscript

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More COBOL Interview Questions

Can anybody give me example of subscript and index

5 Answers  


TO abend the data sholud open in which mode? 1.new 2.old 3.mod 4.shr

1 Answers   MNC,


I have PS flat file with 14 records. I want to read from 4th to 9th record and want to write those 6 records (4th record to 9th record) to another PS file (output file). there is no key defined in the input file. I just want read a certain Consecutive records. can any one please give me the procedure division Coding for this. I have coded the below coding but the READ-PARA is performing only 1 time even though I have 14 records in my input file (i.e FILE-1): PROCEDURE DIVISION. A000-SECTION. MOVE 0 TO I. OPEN INPUT FILE-1. IF CHECK-KEY1 > 0 DISPLAY "OPEN ERROR FOR FILE-1, CODE IS:" CHECK-KEY1 END-IF. OPEN EXTEND NEWFILE-1 IF CHECK-KEY3 > 0 DISPLAY "OPEN ERROR FOR NEWFILE-1 COD IS" CHECK-KEY3 END-IF. PERFORM READ-PARA THRU EXIT-PARA UNTIL EOF-REC = 'YES'. DISPLAY " FINALLY OUT OF LOOP" CLOSE FILE-1 CLOSE NEWFILE-1 STOP RUN. READ-PARA. ADD 1 TO I READ FILE-1 AT END MOVE 'YES' TO EOF-REC IF I > 3 AND < 10 PERFORM WRITE-PARA ELSE DISPLAY "NOT IN RANGE" END-IF. EXIT-PARA. EXIT. WRITE-PARA. WRITE NEW-REC FROM FILE1-REC.

8 Answers   IBM,


What is the difference between Perform para and perform asaection in cobol?

3 Answers   TCS,


what is s013u000 for?

1 Answers   Hewitt,


wht do u mean by (*,intrdr) wht is * used for ?

2 Answers  


Is it possible to mutliply a comp variable with an comp-3 variable. Will there be any error if i do it?

3 Answers   IBM, UST,


db2 variable decimal(15,2) what is the equalent size of cobol variable

2 Answers   Syntel,


level number 77 is used to define a)group data b)elementary data c)redefine d)none

8 Answers   TCS,


i want a program using by if, evaluate , string, unstring, perform, occurs?

1 Answers  


Can anyone tell me how to handle the array beyond the limit. If we have an array or a table which can handle 5000 records but now we have to compensate 20000 records with the same array? how to handle the situation.

2 Answers  


what is the difference between start and startbr?

2 Answers  


Categories