Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 147
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: 147
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: 147
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: 2276
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: 147
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us