IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Copy one file to possible multiple files


IBM Mainframe Forums -> SYNCSORT
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
dibyendumandal11111

New User


Joined: 13 Feb 2017
Posts: 7
Location: india

PostPosted: Fri Mar 08, 2019 2:47 am
Reply with quote

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
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Fri Mar 08, 2019 4:52 am
Reply with quote

show sample input and output expected.
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1231
Location: Bamberg, Germany

PostPosted: Fri Mar 08, 2019 7:30 am
Reply with quote

OP might be using a competitors sort product and if so should ask the question in the according subforum. icon_arrow.gif

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Fri Mar 08, 2019 9:28 am
Reply with quote

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
View user's profile Send private message
dibyendumandal11111

New User


Joined: 13 Feb 2017
Posts: 7
Location: india

PostPosted: Fri Mar 08, 2019 10:55 am
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Mar 08, 2019 3:55 pm
Reply with quote

So why post in the DFSort section of the forum instead of the Syncsort part? Topic moved.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Mar 08, 2019 4:58 pm
Reply with quote

For that sample input please show the sample output. Please use the code tags when posting data, code, etc.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Sat Mar 09, 2019 12:45 am
Reply with quote

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
View user's profile Send private message
dibyendumandal11111

New User


Joined: 13 Feb 2017
Posts: 7
Location: india

PostPosted: Mon Mar 11, 2019 1:22 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Mar 11, 2019 1:55 am
Reply with quote

www-01.ibm.com/support/docview.wss?uid=isg3T7000094
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top