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

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

0 Answers  


after udatingg first 110 rows, my job abends. now how do i change my cobol program so that when i restart the Job it will start updating from 111th row ( i.e in next run I di=ont want to update those 110 rows which are already been updated in the first run before job abend)

7 Answers   Allianz, Wipro,


Why occurs cannot be used in 01 level in COBOL?

0 Answers   Arigo Infotech,


What is perform what is varying?

0 Answers  


whats the difference between search and search all?

4 Answers   Patni,






In a program, variables are used but no DB2 involved in it. Can you call it as host variables??

4 Answers   EDS,


Difference between lrecl, blksize among PS, PDS issues? i.e in jcl at dcb

1 Answers  


how we can reverse the string in the cobol for example satheesh can be reveresed as hseehtas

3 Answers   IBM,


What is a SSRANGE and NOSSRANGE?

0 Answers  


i want to store 20 digits . h will u do it in cobol ?

4 Answers   TCS,


What is the problem of ordered sequential files access?

0 Answers  


I try to use some column names in my cobol progorm but these column not in db2 table ..when do i get error ..while bind time or runtime?

2 Answers  


Categories