Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: splitting input file to 2 output file(file1 file2) by SORT?
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    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Mon Oct 26, 2009 8:56 pm    Post subject:
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    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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us