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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm


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