View previous topic :: View next topic
|
Author |
Message |
preeth
New User
Joined: 14 Sep 2006 Posts: 11
|
|
|
|
i have a file with header, detail and trailer.. i want to sort the detail records only, and in the sortout i want my header and trailer present to, with the detail records.
i was looking into it and figured that this can be done with outrec, but i dont know how and i am kinda pressed for time.
any help will be much appreciated
thank you in advance |
|
Back to top |
|
|
preeth
New User
Joined: 14 Sep 2006 Posts: 11
|
|
|
|
i forgot to mention that the format of the sortout should be the same as the sortin that the header should be the first record and trailer should be the last record |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
preeth,
This is was discussed earlier. Please search the forum. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
Back to top |
|
|
preeth
New User
Joined: 14 Sep 2006 Posts: 11
|
|
|
|
thank u, that link is very helpful, however wouldnt the overlay change the value of the record at whatever column you specify it at. my file is of record length 200. so what do i spedify the column to overlay as. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
I can remember Frank showing the code to do this somewhere, and how he did it was to remove the overlaid parts at some stage to produce the final file as required.
This is off the top of my head from memory - so may be wrong ....
The the original record length was increased to accomodate the overlays.
HEADER = 1, DATA = 2, TRAILER = 3
The overlays were then used as the major key of the sort sequence,
OVERLAY, real sort field 1, real sort field 2, etc. etc.
and then they are removed in the final output of the record, and the output record was the same length as the input record. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
|