View previous topic :: View next topic
|
Author |
Message |
dibyendumandal11111
New User
Joined: 13 Feb 2017 Posts: 7 Location: india
|
|
|
|
Hi,
I have a flat file with Header ,detail and Trailer Record. Depending upon the unique identifier in Header I need to copy the records in any of the possible 5 output files.
For ex- My header record is HA1/HA2..../HA5
Depending upon A1 to A5 I need to copy the records in either File1/File2..
/File5
How can I do this with Sort(not through ICETOOL,as it's not installed in our shop)
Thanks in advance |
|
Back to top |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 419 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
show sample input and output expected. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1231 Location: Bamberg, Germany
|
|
|
|
OP might be using a competitors sort product and if so should ask the question in the according subforum.
Beside that a simple RTFM will help assigning an unique key WHEN a GROUP BEGINs with HDR1..5 and ENDs at TRL1..5 in either INREC or OUTREC.
Splitting happens afterwards with OUTFIL INCLUDE by the unique key.
Cheers,
Jörg |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
dibyendumandal11111 wrote: |
... How can I do this with Sort(not through ICETOOL,as it's not installed in our shop) ...
|
There are two major sort products: DFSORT (message codes ICE...) and Syncsort (message codes WER...). If you have DFSORT then you should have ICETOOL. You probably have one or the other. Someone can probably help you if you can tell us which product you have installed. |
|
Back to top |
|
|
dibyendumandal11111
New User
Joined: 13 Feb 2017 Posts: 7 Location: india
|
|
|
|
Hi Steve,
I mean to say in our shop we don't have DFSORT. We are using Syncsort here.
Details of Input file-
HA1
1234
2345
T030819
So when our sort will run data will be copied in output file- File1(File2 to File5 will be empty)
Similarly if we have Header HA2, input data will be copied to File2.
When I am telling data,I mean to say content(only detail record) of input file.
Thanks in advance. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
So why post in the DFSort section of the forum instead of the Syncsort part? Topic moved. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
For that sample input please show the sample output. Please use the code tags when posting data, code, etc. |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
I mean to say in our shop we don't have DFSORT. We are using Syncsort here |
dibyendumandal11111,
Then in that case you must be having Syncsort's equivalent product SYNCTOOL installed.
Joerg.Findeisen has already mentioned above one way of achieving this using a SORT application.
ie, Use WHEN=GROUP, BEGIN=(1,1,CH,EQ,C'H') and propagate(PUSH) your header id - 'HAn' across all the records, then have 5 OUTFILs to INCLUDE each 'HAn' set of detail records. |
|
Back to top |
|
|
dibyendumandal11111
New User
Joined: 13 Feb 2017 Posts: 7 Location: india
|
|
|
|
Hi Anuj,
Thanks for the reply. Do you have any sample code snippet for this, so that I can get an idea and try it out.
Thanks in advance.
Dev |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
Back to top |
|
|
|