MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Split a file into 2 checking 2 fields

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
maxisnowhere
Beginner


Joined: 25 May 2005
Posts: 59
Topics: 20

PostPosted: Fri May 30, 2008 10:32 am    Post subject: Split a file into 2 checking 2 fields Reply with quote

Hi Guys,

I have a small problem but have no idea on how to solve it.

I have a file like:

Code:
1AS
2BB
3CG
4DD


I want to split the cases with column 2 = column3 and the others, so i want two output like:

file 1:
Code:
2BB
4DD

file 2:
Code:
1AS
3CG


I couldn't find anythink....sorry and thanks!
_________________
Maxisnowhere
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri May 30, 2008 10:39 am    Post subject: Reply with quote

maxisnowhere,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICEMAN                     
//SYSOUT   DD SYSOUT=*                         
//SORTIN   DD *                                 
1AS                                             
2BB                                             
3CG                                             
4DD                                             
//OUT1     DD SYSOUT=*                         
//OUT2     DD SYSOUT=*                         
//SYSIN    DD *                                 
  SORT FIELDS=COPY                             
  OUTFIL FNAMES=OUT1,INCLUDE=(2,1,CH,EQ,3,1,CH)
  OUTFIL FNAMES=OUT2,SAVE                       
/*


Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
maxisnowhere
Beginner


Joined: 25 May 2005
Posts: 59
Topics: 20

PostPosted: Fri May 30, 2008 10:40 am    Post subject: Reply with quote

mmmm bonk bonk bonk thanks a lottttt!!!
_________________
Maxisnowhere
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group