Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Splitting output files in SELCOPY

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
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    Post subject: Splitting output files in SELCOPY
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    Post subject: Splitting output files in SELCOPY
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    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us