Hi All,
I have a file lets say with 990 records. I want to divide it into separate files with 100 records each and last few records in one file.
How can I do it using rexx.
Currently I am just reading the records in a stem with do loop I am segregating 100 records and writing them.
Is there any other simple way to do it?
Dividing a file.
Moderators: Veera, Moderator Group
-
- Member
- Posts: 7
- Joined: Sat Apr 06, 2013 9:11 am
- Location: Chicago
Dividing a file.
Visi
Use DFSort
But if you really need to do it in Rexx:
is one way to do it. The way you are doing it is another and probably simpler.
But if you really need to do it in Rexx:
Code: Select all
0 - read a record
1 - allocate first output file
2 - do while not eof
3 - Read record
4 - write record
5 - increment counter
6 - when counter = 100
set counter to 0
close current file
open next file
end do while
Regards
Nic
Nic
FREE TUTORIALS
Tutorials
Free tutorials from mainframegurukul
- JCL Tutorial
Covers all important JCL concepts. - Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3. - DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming. - SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples - CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page