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
 
splitting a file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 177
Location: Coimbatore

PostPosted: Fri Mar 24, 2017 11:51 am    Post subject: splitting a file
Reply with quote

Hi,

I do have an input file. I have to split the files based on a key and send it to FTP server. Issue here is I am not sure of how many unique keys the input file will have. if there are 3 keys then 3 files needs to be created. If there are 5 keys, 5 files needs to be created.

Could anybody suggest me a way.

Code:
                               06F72600015908473     21810                    1*
0559002GR GGL20L-CWZGBA  032317H 2ZZMCA0055900021017                         B2*
01J4LB23                                                                       
06    20170210                                                                 
                               06F77400015908476     21810                   1*
0559002GR GGL25L-CWZGBA  032317H 2BZMCA0055900021317                         B2*
0083LC30                                                                       
06    20170213                                                                 
                               06F82400015908475     21811                    1*
0559002GR GGL20L-CWZGBA  032317H 2ZZMCA0055900021117                         B2*
04U7LA40                                                                       
06    20170211                                                                 
                               06F72600015908473     21812                    1*
0559002GR GGL20L-CWZGBA  032317H 2ZZMCA0055900021017                         B2*
01J4LB23                                                                       
06    20170210                                                                 
                                                       


Here the keys are 21810, 21811, 21812. I am sure I can pad this keys towards the end with some sequence no and get it in 3 separate files.

But when I execute it next time there can be 10 keys present. How to dynamically define the file names to get the data separately in 10 separate files ?.
Back to top
View user's profile Send private message

abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 177
Location: Coimbatore

PostPosted: Fri Mar 24, 2017 11:59 am    Post subject:
Reply with quote

I hope we can use dynamic files in cobol to create the files based on how many keys we receive. I have not tried this yet.

But need to check if we can easily do it by SORT.

Kindly advice.
Back to top
View user's profile Send private message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 177
Location: Coimbatore

PostPosted: Fri Mar 24, 2017 12:21 pm    Post subject:
Reply with quote

One more information,

When you see the first 8 records belong to key 21810, so it has to be grouped and sent to a separate file. for 21811, there are 4 records, similarly for 21812.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Mar 24, 2017 7:19 pm    Post subject:
Reply with quote

You could dynamically build your split JCL using a DFSORT step and then submit it through internal reader. But if you're planning to implement this in production, you might want to follow the programming approach depending on your site standards and policies.
Back to top
View user's profile Send private message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 177
Location: Coimbatore

PostPosted: Mon Mar 27, 2017 10:11 am    Post subject:
Reply with quote

Thanks Arun for your response. I am trying to do it via COBOL program as of now.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts doubt when executing a file when logg... Renato Zangerolami TSO/ISPF 2 Fri Feb 07, 2020 6:07 pm
No new posts mainframe ps file to unix box alpit All Other Mainframe Topics 4 Fri Feb 07, 2020 11:19 am
No new posts Issue in SFTP a file yuvan All Other Mainframe Topics 1 Tue Feb 04, 2020 6:08 pm
No new posts Compare 2 records of the same PS file... Twinkle22 COBOL Programming 10 Fri Jan 31, 2020 3:25 pm
No new posts SFTP to a Unix Pipe file yuvan All Other Mainframe Topics 4 Tue Jan 28, 2020 9:04 pm

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