Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Copy one file to possible multiple files

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> SYNCSORT
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    Post subject: Copy one file to possible multiple files
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: 300
Location: Cincinnati OH USA

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

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

New User


Joined: 15 Aug 2015
Posts: 50
Location: Germany

PostPosted: Fri Mar 08, 2019 7:30 am    Post subject:
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: 765
Location: The Universe

PostPosted: Fri Mar 08, 2019 9:28 am    Post subject: Re: Copy one file to possible multiple files
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    Post subject:
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: 2249
Location: Hampshire, UK

PostPosted: Fri Mar 08, 2019 3:55 pm    Post subject: Reply to: Copy one file to possible multiple files
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: 2249
Location: Hampshire, UK

PostPosted: Fri Mar 08, 2019 4:58 pm    Post subject: Reply to: Copy one file to possible multiple files
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    Post subject:
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    Post subject:
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

Senior Member


Joined: 14 Mar 2007
Posts: 10632
Location: italy

PostPosted: Mon Mar 11, 2019 1:55 am    Post subject: Reply to: Copy one file to possible multiple files
Reply with quote

https://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.    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Substring for 2 files in Sort JCL Shubhendu Chakraborty DFSORT/ICETOOL 1 Wed Nov 20, 2019 11:07 am
No new posts Substring for 2 files in Sort JCL Shubhendu Chakraborty SYNCSORT 5 Wed Nov 20, 2019 11:04 am
No new posts Is multiple program names allowed in ... Sakthidevi PL/I & Assembler 1 Tue Nov 19, 2019 11:12 pm
No new posts File transfer issue with end of line ... VINAY PALLELA TSO/ISPF 4 Thu Nov 14, 2019 12:01 am
No new posts adrdssu for copy all data robyjhl JCL & VSAM 5 Tue Nov 12, 2019 11:17 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us