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

splitting a file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
abdulrafi

Active User


Joined: 14 Sep 2009
Posts: 184
Location: Coimbatore

PostPosted: Fri Mar 24, 2017 11:51 am
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: 184
Location: Coimbatore

PostPosted: Fri Mar 24, 2017 11:59 am
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: 184
Location: Coimbatore

PostPosted: Fri Mar 24, 2017 12:21 pm
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: 2481
Location: @my desk

PostPosted: Fri Mar 24, 2017 7:19 pm
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: 184
Location: Coimbatore

PostPosted: Mon Mar 27, 2017 10:11 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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 Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
Search our Forums:

Back to Top