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 |
in how many mode we can open a file ?
How to read the last 100 records from a COBOL file. The file contains N number of records.
Will the variable POS in the following code have a value of 2 or not? 01 POS PIC S9(4) COMP VALUE 2. 01 FIRST-NAME PIC X(10) VALUE 'ABC'. 01 LAST-NAME PIC X(10) VALUE 'XYZ'. 01 NAME PIC X(20) VALUE SPACES. STRING FIRST-NAME DELIMITED BY SPACES ' ' DELIMITED BY SIZE LAST-NAME DELIMITED BY SPACES INTO NAME WITH POINTER POS
Have you code any new programs in COBOL ? What is the functionality of the programs?
What rules are followed by the search verb.
If you are current on the owner of a set, what is the difference between an obtain next and obtain first? Actually in which topic will we use dis???Plz explain it clearly
What is difference between comp & comp-4?
What are the different forms of EVALUATE statement?
Which of the following characters is NOT valid in column 7? a. - b. \ c. * d. # e. $
What is the difference between structured cobol programming and object alternativelyiented cobol?
System Testing for Mainframe Developers What is System Testing? integration testing ? what's the procedure ..
How do you define a sort file in JCL that runs the COBOL program?