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

splitting input file to 2 output file(file1 file2) by SORT?


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

New User


Joined: 15 Dec 2005
Posts: 21

PostPosted: Mon Oct 26, 2009 6:52 am
Reply with quote

Input records
1XGLW GLW 0016 USA470590680
1XGLW GLW 0016 USA470590680
1XGLW GLW 0024 USA470590680
1XGLW GLW 0024 USA470590680
1XGLW GLW 0024 USA470590680
1XGLW GLW 0018 USA470590680
1XGLW GLW 0018 USA470590680
1XGLW GLW 0019 USA470590680
1XGLW GLW 0019 USA470590680
1XGLW GLW 0019 USA470590680
1XGLW GLW 0019 USA470590680
1XGLW GLW 0020 USA470590680
1XGLW GLW 0021 USA470590680
1XGLW GLW 0021 USA470590680

Output file1:
1XGLW GLW 0016 USA470590680
1XGLW GLW 0016 USA470590680
1XGLW GLW 0018 USA470590680
1XGLW GLW 0018 USA470590680
1XGLW GLW 0021 USA470590680
1XGLW GLW 0021 USA470590680

Output file2
1XGLW GLW 0019 USA470590680
1XGLW GLW 0019 USA470590680
1XGLW GLW 0019 USA470590680
1XGLW GLW 0019 USA470590680
1XGLW GLW 0020 USA470590680
1XGLW GLW 0024 USA470590680
1XGLW GLW 0024 USA470590680
1XGLW GLW 0024 USA470590680

There are accounts number having one row, two rows, three rows and n number of rows. But i want to write only the two rows records in file1 and rest all should be written in file 2.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Oct 26, 2009 8:35 am
Reply with quote

Hi Vijayprabhu,
Use below SORTSTEP to get desired result.
Code:

//S1   EXEC  PGM=ICETOOL           
//TOOLMSG   DD  SYSOUT=*           
//DFSMSG    DD  SYSOUT=*           
//INP  DD *                         
1XGLW GLW 0016 USA470590680             
1XGLW GLW 0016 USA470590680             
1XGLW GLW 0024 USA470590680             
1XGLW GLW 0024 USA470590680             
1XGLW GLW 0024 USA470590680             
1XGLW GLW 0018 USA470590680             
1XGLW GLW 0018 USA470590680             
1XGLW GLW 0019 USA470590680             
1XGLW GLW 0019 USA470590680             
1XGLW GLW 0019 USA470590680             
1XGLW GLW 0019 USA470590680             
1XGLW GLW 0020 USA470590680             
1XGLW GLW 0021 USA470590680             
1XGLW GLW 0021 USA470590680             
/*                                     
//OUT1   DD  SYSOUT=*                   
//OUT2   DD  SYSOUT=*                   
//TOOLIN DD *                                                       
  SELECT FROM(INP) TO(OUT1) DISCARD(OUT2) ON(11,4,CH) EQUAL(2)     
/*                                                                 

Out1
Code:

1XGLW GLW 0016 USA470590680       
1XGLW GLW 0016 USA470590680       
1XGLW GLW 0018 USA470590680       
1XGLW GLW 0018 USA470590680       
1XGLW GLW 0021 USA470590680       
1XGLW GLW 0021 USA470590680       

Out2
Code:

1XGLW GLW 0019 USA470590680
1XGLW GLW 0019 USA470590680
1XGLW GLW 0019 USA470590680
1XGLW GLW 0019 USA470590680
1XGLW GLW 0020 USA470590680
1XGLW GLW 0024 USA470590680
1XGLW GLW 0024 USA470590680
1XGLW GLW 0024 USA470590680
Back to top
View user's profile Send private message
vijayprabu

New User


Joined: 15 Dec 2005
Posts: 21

PostPosted: Mon Oct 26, 2009 10:38 am
Reply with quote

Thank you somuch. I got my expected result. But I was wondering whether is this possible in DFSORT?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Oct 26, 2009 10:56 am
Reply with quote

Quote:
But I was wondering whether is this possible in DFSORT?

ICETOOL internally calls DFSORT only....
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 26, 2009 8:56 pm
Reply with quote

Quote:
But I was wondering whether is this possible in DFSORT?


ICETOOL is part of DFSORT. ICETOOL has been shipped with DFSORT since 1991!
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
Search our Forums:

Back to Top