IBM MAINFRAME HELP & SUPPORT FORUMS
Technical Forums for IBM Mainframe Applications like COBOL, JCL, CICS, DB2, FileAid, DFSORT, Endevor, Xpediter, CoolGen, CA-7&11, AbendAid, IMS, IDMS, PL/I, MqSeries, SyncSort, Assembler, ChangeMan, Easytrieve, InterTest, REXX, CLIST etc...
 

How to sort the records leaving the first and the last

THIS IS AN ARCHIVE FORUM: CLICK HERE TO GO TO THE ORIGINAL TOPIC

 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> DFSORT/ICETOOL
View previous topic :: View next topic  
Author Message
sri_mf



Joined: 31 Aug 2006
Posts: 197
Location: At my Desk

Posted: Wed Aug 06, 2008 3:41 pm    Post subject: How to sort the records leaving the first and the last  

Hi ,

I need to sort a Sequential file of RECFM=FB and LRECL=80
Here i should not sort the first and the last records.So the records between the first and Last records should be sorted.

Sort Fileds=(1,4,ch,a)

Input

AAAAA
CCCCC
BBBBB
XXXXX
DDDDD
ZZZZZ

Output
AAAAA
BBBBB
CCCCC
DDDDD
XXXXX
ZZZZZZZ
Back to top  
sri_mf



Joined: 31 Aug 2006
Posts: 197
Location: At my Desk

Posted: Wed Aug 06, 2008 3:42 pm    Post subject: Reply to: How to sort the records leaving the first and the  

Typo Mistake : ZZZZZZZ
It should be ZZZZZ
Back to top  
Aaru



Joined: 03 Jul 2007
Posts: 1148
Location: Mumbai - India

Posted: Wed Aug 06, 2008 3:51 pm    Post subject: Reply to: How to sort the records leaving the first and the  

Sri,

Did you check the new DATASORT operator introduced in DFSORT? I think this can be done easily using the new operator?
Back to top  
sri_mf



Joined: 31 Aug 2006
Posts: 197
Location: At my Desk

Posted: Wed Aug 06, 2008 4:06 pm    Post subject: Re: Reply to: How to sort the records leaving the first and  

Thanks Aaru for your suggestion But i do not have PTF installed.

Frank Rpely in that Link: Note that you will need z/OS DFSORT V1R5 PTF UK90013 (July, 2008) in order to use the new DATASORT operator
Back to top  
expat



Joined: 14 Mar 2007
Posts: 3544
Location: Brussels once more ...

Posted: Wed Aug 06, 2008 4:08 pm    Post subject:  

Have you searched the forum, as I do recall a request to do EXACTLY what you want to do.

I think HEADER and TRALER were in the title of the thread, or the text body, so should not be too difficult to find.
Back to top  
Aaru



Joined: 03 Jul 2007
Posts: 1148
Location: Mumbai - India

Posted: Wed Aug 06, 2008 4:23 pm    Post subject: Reply to: How to sort the records leaving the first and the  

Sri,

Quote: Here i should not sort the first and the last records.So the records between the first and Last records should be sorted.

whther The first and last records will always be AAAAA and ZZZZZ respectively????? If yes, as suggested search the forum as it has been discussed many times.
Back to top  
sri_mf



Joined: 31 Aug 2006
Posts: 197
Location: At my Desk

Posted: Wed Aug 06, 2008 5:09 pm    Post subject: Re: Reply to: How to sort the records leaving the first and  

Aaru wrote: Sri,

Quote: Here i should not sort the first and the last records.So the records between the first and Last records should be sorted.

whther The first and last records will always be AAAAA and ZZZZZ respectively????? If yes, as suggested search the forum as it has been discussed many times.

I got some code after some thorough search.
I made the changes as per my requirement and it worked fine.
Thanks Aaru and Expat.
Actulaly i missed that in my first Search.
:(
Back to top  
Aaru



Joined: 03 Jul 2007
Posts: 1148
Location: Mumbai - India

Posted: Wed Aug 06, 2008 5:11 pm    Post subject: Reply to: How to sort the records leaving the first and the  

You are welcome and good that it is working.
Back to top  
Frank Yaeger



Joined: 15 Feb 2005
Posts: 4613
Location: San Jose, CA

Posted: Wed Aug 06, 2008 10:41 pm    Post subject:  

If you have z/OS DFSORT V1R5 PTF UK90013 (July, 2008), you can use the new DATASORT operater to do this kind of thing. See:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/

If you can't use DATASORT, you can use the older technique described in the "Sort records between a header and trailer " Smart DFSORT Trick at:

www.ibm.com/systems/support/storage/software/sort/mvs/tricks/
Back to top  
sri_mf



Joined: 31 Aug 2006
Posts: 197
Location: At my Desk

Posted: Thu Aug 07, 2008 9:49 am    Post subject: Reply to: How to sort the records leaving the first and the  

Thank you Frank...I do not have z/OS DFSORT V1R5 PTF UK90013 so i have opted the second choice
Back to top  
Frank Yaeger



Joined: 15 Feb 2005
Posts: 4613
Location: San Jose, CA

Posted: Thu Aug 07, 2008 10:10 pm    Post subject:  

Quote: I do not have z/OS DFSORT V1R5 PTF UK90013 so i have opted the second choice

Ask your System Programmer to install that PTF (it's free).
Back to top  
 
       IBMMAINFRAMES.com - IBM Mainframe Support Forums Index -> DFSORT/ICETOOL
Page 1 of 1
THIS IS AN ARCIVE FORUM IN READ ONLY MODE. IF YOU WANT TO ASK YOUR DOUBTS USE THE ACTUAL FORUM