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

Splitting output files in SELCOPY


IBM Mainframe Forums -> All Other Mainframe Topics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sasti_a

New User


Joined: 20 Oct 2008
Posts: 4
Location: UK

PostPosted: Wed Jan 28, 2009 7:31 pm
Reply with quote

Hi,
I have a requirement to use SELCOPY and split the output file such that the output is split between the three output files. For example if I have 31000 records in my input file, it should be split in this fashion.
First 10000 goes to output file 1
second 10000 goes to output file 2
remaining 11000 goes to output file 3.
I know the syntax in DFSORT, but not sure about SELCOPY.
Back to top
View user's profile Send private message
Nick Jones

New User


Joined: 28 Apr 2009
Posts: 13
Location: UK

PostPosted: Thu Apr 30, 2009 1:34 am
Reply with quote

you can use the INCOUNT field to interrogate the record number of the last record read from the prime input file. SELCOPY syntax to match your spec follows...

Code:
READ INDD     * Read the next input record.

IF INCOUNT < 10001   * Record numbers up to 10000.
  THEN WRITE OUTDD1   
  THEN GOTO GET      * Back to the first control statement.

* Record numbers > 10000 processed from here on.
IF INCOUNT < 20001   * Record numbers up to 20000.
  THEN WRITE OUTDD2
  ELSE WRITE OUTDD3  * All record numbers over 20000.

* SELCOPY automatically loops back to the first control statement.
* Processing ends when prime input (INDD) end-of-file is reached.
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 -> All Other Mainframe Topics

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
Search our Forums:

Back to Top