copy 100 records without using ibm utilities

Answers were Sorted based on User's Feedback



copy 100 records without using ibm utilities..

Answer / swapnil

USING AN OCCURS CLAUSE WE MOVE RECORD FROM ONE PS FILE TO
ANOTHER PS

Is This Answer Correct ?    5 Yes 0 No

copy 100 records without using ibm utilities..

Answer / vaneesh

MOVE 0 TO WS-COUNTER
MOVE N TO END-OF-FILE

PERFORM 1000-COPY-PARAGRAPH UNTILL (WS-COUNTER = 100 OR END-
OF-FILE = 'Y'.

100-COPY-PARAGRAPH.
READ INPUT FILE
AT END MOVE Y TO END-OF-FILE
NOT AT END MOVE IN-REC TO OUT-REC
ADD +001 TO WS-COUNTER.
1000-EXIT.
EXI.

Is This Answer Correct ?    4 Yes 0 No

copy 100 records without using ibm utilities..

Answer / mahendra.ch

1st way to copy records to an other ps.

open input in-file
output out-file.
perform until end-of-file = 'y'
read in-file
at at end move 'y' to end-of-file
not at end
move in-rec to out-rec
write out-rec
end-read
end-perform.
close in-file.
close out-file.


2st way to copy records to an other ps.

we can copy the records by using file-aid tool also.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More COBOL Interview Questions

COMP field occupy ?

2 Answers  


hw to create 3 dimensional array & hw to access it?

1 Answers  


What are the differences between OS VS COBOL and VS COBOL II?

1 Answers   IBM,


Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?

1 Answers  


Suppose i have a Cobol field of 10 byte. it contains a decimal sign.How to know where is the point location?

1 Answers  


What is the difference between PIC 9.99 and 9v99?

7 Answers  


how do u indetify files succesfully executed or not ?

4 Answers   TCS,


I have a table with 3 dimensions like this : 01 ws-table 04 ws-page occurs 3 08 ws-column occurs 2. 12 ws-record occurs 20 pic x(40). How to code with PERFORM varying with 3 dimension...I forgot..

2 Answers   EDS,


What is LENGTH in COBOL II?

2 Answers   CSC,


Which is the best IBM mainframe Training Institute in Ameerpet, Hyderabad

35 Answers  


diffrence between renames and redifnes with examples

3 Answers   IBM,


How do you submit JCL via a Cobol program?

5 Answers   IBM,


Categories