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 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 Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am

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