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
 
Reporting using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Tue Sep 15, 2009 3:00 am    Post subject: Reporting using SORT
Reply with quote

I have a file which has 100,000 records where the first record is a header.
I need to split this file into two files at 50,000th records. but need the header on the second files also.

Can i do this on a single sort step.
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Sep 15, 2009 4:43 am    Post subject:
Reply with quote

Hi,

you can try this
Code:
//S1       EXEC PGM=ICETOOL                                         
//TOOLMSG  DD SYSOUT=*                                               
//DFSMSG   DD SYSOUT=*                                               
//IN       DD DSN=INPUT-FILE,DISP=SHR                               
//FILE1    DD DSN=OUTPUT-FILE1,DISP=(,CATLG,DELETE)                 
//FILE2    DD DSN=OUTPUT-FILE2,DISP=(MOD,CATLG,DELETE)               
//TOOLIN   DD *                                                     
COPY FROM(IN) TO(FILE1) USING(CTL1)                                 
COPY FROM(IN) TO(FILE2) USING(CTL2)                                 
COPY FROM(IN) TO(FILE2) USING(CTL3)                                 
/*                                                                   
//CTL1CNTL DD *                                                     
  SORT FIELDS=COPY,STOPAFT=50000                                     
/*                                                                   
//CTL2CNTL DD *                                                     
  SORT FIELDS=COPY,STOPAFT=1                                         
/*                                                                   
//CTL3CNTL DD *                                                     
  SORT FIELDS=COPY,SKIPREC=50000                                     
/*


You can also look at the SUBSET operand but my version of DFSORT does not allow me to test it.


Gerry
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Sep 15, 2009 5:18 am    Post subject:
Reply with quote

antonyjoseph,

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

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT1 DD DSN=...  output file1
//OUT2 DD DSN=...  output file2
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT1) INPUT KEEP FIRST(50000)
SUBSET FROM(IN) TO(OUT2) INPUT KEEP FIRST RRN(50001,*)
/*
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

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