sorting with excluding header and trailer



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

sorting with excluding header and trailer

Postby arya_starc » Thu Jun 09, 2016 3:42 pm

Suppose if this is my input file

HEADER
1111AAAA
3333CCCC
2222BBBB
TRAILER



I want to sort this input file excluding the HEADER and TRAILER but the HEADER and TRAILER should be in the output of the sorted file.

i.e this should be the output

HEADER
1111AAAA
2222BBBB
3333CCCC
TRAILER



Is there a way to do it?
arya_starc
 
Posts: 136
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time

Re: sorting with excluding header and trailer

Postby NicC » Thu Jun 09, 2016 4:34 pm

If you are wanting a sort solution why do you post in the Cobol section? And why do you not use the code tags? And why not give all the required details - LRECL, RECFM, approximate record count.

BTW - you have "datasets" not "files".

And why have you not searched or read the manuals? There you would have come across the DATASORT operator.

Moving to DFSort section.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: sorting with excluding header and trailer

Postby BillyBoyo » Thu Jun 09, 2016 10:18 pm

ICETOOL's DATASORT is for exactly that case.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: sorting with excluding header and trailer

Postby arya_starc » Mon Jun 13, 2016 12:12 pm

yeah..thanks billy


DATASORT FROM(SORTIN) TO(SORTOUT) HEADER TRAILER USING(ABCD)
SORT FIELDS=(27,18,CH,A)
arya_starc
 
Posts: 136
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post