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 

Sort only few records

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


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Wed Mar 11, 2009 12:58 pm    Post subject: Sort only few records Reply with quote

I have a requirement like this , i want to just want to sort only two records from sequence


i/p file(FB & 80 lrecl)

0 --- header
1
2
3
1
2
3
1
2
3
9 ---- trailer

o/p should be

0
1
3
2
1
3
2
1
3
2
9


Thanks,
Siva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Mar 11, 2009 1:12 pm    Post subject: Reply with quote

sivafdms,

You can very easily reorder the specific records using the new WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:


Code:

//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD SYSOUT=*                             
//SORTIN   DD *                                     
0 --- HEADER                                       
1                                                   
2                                                   
3                                                   
1                                                   
2                                                   
3                                                   
1                                                   
2                                                   
3                                                   
9 ---- TRAILER                                     
//SORTOUT  DD SYSOUT=*                             
//SYSIN    DD *                                     
  OPTION EQUALS                                     
  SORT FIELDS=(81,16,CH,A)                         
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'1'), 
  PUSH=(81:ID=8,SEQ=8)),                           
  IFTHEN=(WHEN=(1,1,CH,EQ,C'2'),                   
  OVERLAY=(89:89,8,ZD,ADD,+1,M11,LENGTH=8)),       
  IFTHEN=(WHEN=(1,1,CH,EQ,C'3'),                   
  OVERLAY=(89:89,8,ZD,SUB,+1,M11,LENGTH=8))         
                                                   
  OUTREC BUILD=(1,80)                               
/*


If you don't have the July, 2008 PTF installed, ask your System Programmer to install it (it's free).

For complete details on the new WHEN=GROUP and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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