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 the detail records only

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


Joined: 29 Jun 2004
Posts: 11
Topics: 8
Location: Bangalore

PostPosted: Sat Nov 06, 2004 5:23 am    Post subject: Sort the detail records only Reply with quote

Hi friends,

I have a file which contains the records in the following way

1 header record as the first record
Multiple detail records after the header record
1 trailer record as the last record.

I want to sort only detail records and keep header and detail records as first and last records.How this can be done in an efficient way.
_________________
Regards,
Vishwakiran
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Sat Nov 06, 2004 8:15 am    Post subject: Reply with quote

Vishwakiran,

Please search before posting. This topic has been discussed earlier. check this link

http://www.mvsforums.com/helpboards/viewtopic.php?t=1850&highlight=detail

Use the solution posted at the end.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Wed Aug 13, 2008 4:30 pm    Post subject: Reply with quote

With the new DATASORT operator of DFSORT's ICETOOL, available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008), you can do this kind of thing quite easily like this (replace the SORT fields with whatever you need to sort the detail records):

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER TRAILER USING(CTL1)
/*
//CTL1CNTL DD *
  SORT FIELDS=(1,4,CH,A)
/*


For complete details on the new DATASORT function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
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