IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

HOW TO BREAK ONE file into two or more file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vishal_a

New User


Joined: 24 May 2005
Posts: 45
Location: Noida

PostPosted: Mon Aug 22, 2005 1:29 pm
Reply with quote

please help
i have got one file how to break it into two or more files icon_confused.gif
Back to top
View user's profile Send private message
radhakrishnan82

Active User


Joined: 31 Mar 2005
Posts: 435
Location: chennai, India

PostPosted: Mon Aug 22, 2005 1:33 pm
Reply with quote

Under what condition do you need to break into more than one file?
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Mon Aug 22, 2005 1:42 pm
Reply with quote

Hi,

U can break file in more than one file by using STOPAFT and SKIPREC in sort. So that it can copy particular number of records in file.

Regards
Rupesh
Back to top
View user's profile Send private message
bonniem

New User


Joined: 09 Aug 2005
Posts: 67

PostPosted: Mon Aug 22, 2005 5:09 pm
Reply with quote

If your control card has the following OUTFIL statement

SORT FIELDS=COPY
OUTFIL FILES=(1,2),SPLIT

Then the input records will be evenly split between the output files. In this above case there are 2 output files. The first output file will have record numbers 1,3,5, etc and the second file will have 2,4,6 etc.
Back to top
View user's profile Send private message
jz1b0c

Active User


Joined: 25 Jan 2004
Posts: 160
Location: Toronto, Canada

PostPosted: Mon Aug 22, 2005 7:44 pm
Reply with quote

Hi Vishal,

Here is the example.

//JZ1B0CQ JOB (JZ1B0C,@),
// 'OUTFIL EXAMPLE',
// CLASS=0,
// MSGCLASS=R,
// TIME=(60),
// MSGLEVEL=(1,1),
// NOTIFY=JZ1B0C
//STEP010 EXEC PGM=SORT ,COND=(0,NE)
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//*
//SORTIN DD DSN=JZ1B0C.MASTER.INPUT,
// DISP=SHR
//*
//FILE1 DD DSN=JZ1B0C.SPLIT.FILE1,
// DISP=(NEW,CATLG),RECFM=FB,LRECL=80,
// UNIT=SYSDA,
// MGMTCLAS=WORK5
//*
//FILE2 DD DSN=JZ1B0C.SPLIT.FILE2,
// DISP=(NEW,CATLG),RECFM=FB,LRECL=80,
// UNIT=SYSDA,
// MGMTCLAS=WORK5
//*
//FILE3 DD DSN=JZ1B0C.SPLIT.FILE3,
// DISP=(NEW,CATLG),RECFM=FB,LRECL=80,
// UNIT=SYSDA,
// MGMTCLAS=WORK5
//*
//SYSIN DD *
SORT FIELDS(1,4,CH,A)
OUTFIL INCLUDE=(1,4,CH,EQ,C'2001'),FNAMES=FILE1
OUTFIL INCLUDE=(1,4,CH,EQ,C'2002'),FNAMES=FILE2
OUTFIL SAVE,FNAMES=FILE3
END
/*

File3 is going to have the one's that are not in file1 and file2
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Aug 22, 2005 9:06 pm
Reply with quote

Quote:
i have got one file how to break it into two or more files


How exactly you would do that depends entirely on how you want to break up the files as demonstrated by the different approaches suggested by other posters. See the following for several ways to split a file with DFSORT:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst01.html#t01

If you need more specific help, you need to state exactly what it is you want to do.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top