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

SPLIT Input File in multiple Output Files.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
AJAYREDDY

New User


Joined: 17 Feb 2007
Posts: 52
Location: USA

PostPosted: Mon Oct 27, 2008 7:30 pm
Reply with quote

I have a requirement to SPLIT the file into Multiple output files in a certain count.

For example if the Input has 7000 records, I need these to SPLIT into 3 files. First file 2000 records, second file 2000 records and third file 3000 records.

If the Input has 5000 records, First file 2000 records, second file 2000 records and third file 1000 records.

The concept is, First 2 output files should have 2000 records each and the rest should go into 3rd output File.

On the other hand, if the Input file has maximum of ONLY 1500 records, these all should come inside first file and the rest 2 output files should be empty.

Right now I am assuming Input file will contain maximum of 7000 records.

Please let me know if this can be done by DFSORT or any other utility.
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 Oct 27, 2008 8:38 pm
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//OUT1 DD DSN=...    output file1
//OUT2 DD DSN=...    output file2
//OUT3 DD DSN=...    output file3
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=(OUT1,OUT2,OUT3),SPLIT1R=2000
/*
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
Search our Forums:

Back to Top