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

State the various causes of s0c1, s0c5 and s0c7.

0 Answers  


1.Can we define condition-name conditions in FD entry.

11 Answers  


What are options have been removed in COBOL 11?

1 Answers  


Hi................... I have records like this aaaa cccc bbbb And i want output like this bbbb cccc aaaa How can it possible ?. Note:Please make sure records are in unsorted order. somebody plzzz help me.

1 Answers  


How do you fetch current date in normal cobol pgm and in cobol-db2 pgm?

3 Answers   Cap Gemini, CTS,


What is the difference between PIC 9.99 and 9v99 in COBOL?

0 Answers   SwanSoft Technologies,


hie everyone.i just completed my b.tech in electronics and joined mainframes course.am i doing right course for my better future?please help me with your suggestions.ill be very thankful to you guys.

2 Answers  


what is rediffine clause?in what situation it can use?give me real time example?

1 Answers   IBM,


i want to learn mainframe..any websites and material to learn from basic..? my mail id : rajeswaribe2010@gmail.com

0 Answers  


) How do you access the migrate the data from production region to development region

1 Answers   IBM,


I have File 1 occurs 5 times with Employee-ID,Employee-Name,Employee-Dept (EEE and MECH). I have File 2 occurs 10 times with Employee-ID,Employee-Name,Employee-Dept (EEE,CIVIL,CHEMICAL and MECH). In FIle 1 and FIle 2 , for matching Employee-DEPT (Only MECH) , we need to move entire records from file1 to file 2. We should not use 2D array. Your help is needed here.

0 Answers   Steria,


01 a pic s9(5) occupies how many bytes ?

9 Answers   Wipro,


Categories