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

What are 77 levels used for?

0 Answers  


If i have a variable A pic 9(2) value 10 Compute A = a - 100 what will be the value of A and will there be any error becoz of the Negative value

3 Answers   CTS,


What is difference between com and com3? Eg. s9(4) so what is the memory it will occupy com and com3.

2 Answers  


what is difference between the sysabend and userabend?

2 Answers  


How to resolve the soc4 and soc7 errors?

5 Answers   IBM, RBS,






How many bytes S(8) comp field occupy and its maximum value?

0 Answers  


how to display date in reverse order if the pic clause of the is numeric suppose date is 09032010 ==> need to print in 20100309 (pic clause is numeric)

6 Answers  


subscript and index r not coded in u r application program what will happen?

2 Answers  


what is lrec=f,what is difference between f,fb,v,vb?what is default value?how do we came to know that records are in f,fb,v,vb?

2 Answers   IBM, Wipro,


S9(5)V9(2) occupies how many bytes memory ?

6 Answers   Cap Gemini,


how to know that the file has 300 records how to acess it?

0 Answers   Hewitt, TCS,


can we declare s9(9)v9(9) in cobol ? if yes how many bytes it will occupy ?(urgent plz answer it)

13 Answers   CTS,


Categories