copy 100 records without using ibm utilities
Answers were Sorted based on User's Feedback
Answer / swapnil
USING AN OCCURS CLAUSE WE MOVE RECORD FROM ONE PS FILE TO
ANOTHER PS
Is This Answer Correct ? | 5 Yes | 0 No |
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 |
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 |
1.What is the default print format in cobol?
wht is the difference between goto and perform stmts
How do you compile cobol program..?
HI THIS IS ANIL. HOW TO PASS A RECORDS OF A FILE(PS OR PDS) TO AN ARRAY?
How to code fscode 10 in cobol program? Where yoy code in your pgm?give ans for the question.
01 ws-p pic 9(2). 01 ws-q pic 9(2) value 01. 01 ws-r pic 9(2) value 99. p.d. compute p = q + r what will be result of p ans(00) but my question is that how i got 10 on the place of 00. (truncation will ocuure on right side not left). please tell me ?
What are the divisions in a cobol program? Which one is the mandatory division among them?
Under which scenario you would go for a static call as opposed to dynamic call?
wht is packed decimal in cobol
01 x pic s9(8) comp. How will the following value be internally allocated '18787'
Write a program to explain size error.
i need the code for this program in cobol. 2 + 1 = 3 4+3=7 6+5=11 8+7=15 10+9=19