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 

Split a file

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
aruna_space
Beginner


Joined: 13 Mar 2007
Posts: 15
Topics: 5

PostPosted: Thu May 31, 2007 5:44 am    Post subject: Split a file Reply with quote

the input file : IN

H 10
1
2
3
4
5
6
7
8
9
10
T 10
H 5
11
12
13
14
15
T 5
H 3
16
17
18
T 3

i need to split it into

OUT1:
H 10
1
2
3
4
5
6
7
8
9
10
T 10

OUT2:
H 5
11
12
13
14
15
T 5

OUT3:
H 3
16
17
18
T 3

the File Format for All the files is

Header - (1,1) = H
Trailer - (1,1) = T
others are detail records with pic 9(3)

the number of records in these files are not the same or fixed, they can have any number of records
Please Guide me in doing this spliting.
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


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

PostPosted: Thu May 31, 2007 11:00 am    Post subject: Reply with quote

Aruna_space,

Please search before posting...Check this link.
http://www.mvsforums.com/helpboards/viewtopic.php?t=2584&highlight=split+header+trailer+sort

Thanks,
Phantom
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu May 31, 2007 11:04 am    Post subject: Reply with quote

Here's a DFSORT job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes:

Code:

//S1    EXEC  PGM=ICEMAN                                             
//SYSOUT    DD  SYSOUT=*                                             
//SORTIN DD DSN=&&IN,DISP=(OLD,PASS)                                 
//OUT1 DD SYSOUT=*                                                   
//OUT2 DD SYSOUT=*                                                   
//OUT3 DD SYSOUT=*                                                   
//SYSIN    DD    *                                                   
  OPTION COPY                                                       
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),                 
        IFTHEN=(WHEN=(1,1,CH,EQ,C'H'),                               
                OVERLAY=(81:SEQNUM,8,ZD)),                           
        IFTHEN=(WHEN=NONE,                                           
                OVERLAY=(89:SEQNUM,8,ZD,                             
                         81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))       
  OUTFIL FNAMES=OUT1,INCLUDE=(81,8,ZD,EQ,+1),BUILD=(1,80)           
  OUTFIL FNAMES=OUT2,INCLUDE=(81,8,ZD,EQ,+2),BUILD=(1,80)           
  OUTFIL FNAMES=OUT3,INCLUDE=(81,8,ZD,EQ,+3),BUILD=(1,80)           

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
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 -> Utilities 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