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 |
How to traceback if I am getting SOC7 or SOC4 abend? List down the steps
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)
Why occurs cannot be used in 01 level in COBOL?
What is perform what is varying?
whats the difference between search and search all?
In a program, variables are used but no DB2 involved in it. Can you call it as host variables??
Difference between lrecl, blksize among PS, PDS issues? i.e in jcl at dcb
how we can reverse the string in the cobol for example satheesh can be reveresed as hseehtas
What is a SSRANGE and NOSSRANGE?
i want to store 20 digits . h will u do it in cobol ?
What is the problem of ordered sequential files access?
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?