MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

File Splitting

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
ha.rajamohamed
Beginner


Joined: 29 Jan 2006
Posts: 71
Topics: 22

PostPosted: Tue Feb 07, 2006 9:39 am    Post subject: File Splitting Reply with quote

Is there any way by which we can split the file in to no of file
For Example My file contains

AAAAAA
..
..
..
0000000
AAAAAA
..
..
..
0000000
AAAAAA
..
..
..
0000000

For me the above file should be splitted in to three file, If like the above n number of records are there it needs to split accordingly
with the below content in one file and so on....

AAAAAA
..
..
..
0000000
Back to top
View user's profile Send private message
moyeenkhan
Beginner


Joined: 04 Dec 2002
Posts: 64
Topics: 21

PostPosted: Tue Feb 07, 2006 12:39 pm    Post subject: Reply with quote

Here is the Rexx logic that you can use


1. Allocate Input
2. Read Input
3. OutPut1='XXXXXXXX.XXXXXXX.'0001
4. Allocate Output1
5. Read Input Till End
If TheFirst6Bytes ='000000' Then Do
Add 1 to COunt
Close Output
Output='XXXXXXxx.XXXXXXX.'||Right(COunt,4)
Allocate Output
End
Write Output
6. CLose Input / Output
Back to top
View user's profile Send private message Send e-mail
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Wed Feb 08, 2006 1:46 am    Post subject: Reply with quote

rajamohamed,

I believe you have a file with set of header-detail-trailer records. I assume that the records that start with AAAAAA are headers and that have '000000' are trailer records. You can use Sort to do the splitting efficiently, but it would be easy if you have any field in the header or trailer than can differenciate each header and trailer. I mean, instead of having just AAAAAA for header, if your dataset has AAAAAA1 for header 1, AAAAAA2 for header 2 and so on it would become very simple.

show us a sample of how your data is stored actually in your input file.

Thanks,
Phantom
Back to top
View user's profile Send private message
ha.rajamohamed
Beginner


Joined: 29 Jan 2006
Posts: 71
Topics: 22

PostPosted: Wed Feb 08, 2006 4:26 am    Post subject: Reply with quote

Phantom,
I can have 10 header records followed by detail record and its trailer recods respectively. Now I need to split all the 10 in to separate files.

Header (AAAAAAA -----followed by some details unique)
Detail Record1
Detail Record2
..
Detail Recordn
Trailer(000000000)

Header (AAAAAAA -----followed by some details unique)
Detail Record1
Detail Record2
..
Detail Recordn
Trailer(000000000)


This AAAAAAA for header and "000000000" for trailer are constants values to identify Header and Trailer records.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Wed Feb 08, 2006 8:48 am    Post subject: Reply with quote

ha.rajamohamed,


Tailor your solution with solution provided here

http://mvsforums.com/helpboards/viewtopic.php?t=61&highlight=split

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group