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

Can you REWRITE a record in an ESDS file? Can you DELETE a record from it?

6 Answers   ABC, IBM, Mphasis, Wipro,


Can you call an OS VS COBOL pgm from a VS COBOL II pgm ?

3 Answers   Microsoft,


I have a source program compiled with Cobol-2. The output file has a record length of 100 defined in the program but a record of 60 bytes getting written into it. i.e. The rest of 40 bytes I am not Writing anything. But it by default puts some values into the last 40 bytes. However it does not impact anything. But when Compiled the module with Enterprise Cobol the last 40 bytes were spaces as fillers. Can anyone explain?

5 Answers   Cognizant,


How can we increase the size of an existing PDS to include more no. of modules.

3 Answers  


How do u find the programs calling the given module, without having doing 3.13 on loadlib/source library?

2 Answers  






Difference between next and continue clause

4 Answers   Kanbay,


How can you submit a job from COBOL programs?

2 Answers   ITC Infotech,


what is record label is empty or standard in file description of data division?

2 Answers   HCL,


How to recover a deleted source physical file from library?

1 Answers   HCL,


C1 C2 C3 are three conditions whose TRUTH values are as folloes. C1-TRUE C2-FALSE C3-TRUE A,B,C are defined as given below A:C1 AND(NOT C2) OR C3 B.(NOT C1) OR (NOT C2 AND NOT C3) C.(C1 OR C2)AND C3 D.C1 AND C2 OR C3 given the above information which of the following statements are valid? a.only A,B and C are TRUE b.only A,C and D are TRUE c.A,B,C and D are TRUE d.only C and D are TRUE

1 Answers   TCS,


How do you reference the following file formats from cobol programs?

0 Answers  


Extract only those records from a PS file which are having word 'TEXT' in the records using COBOL? The word TEXT is not present in a particular position in all the records.

2 Answers   RBS,


Categories