Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Splitting the DAT file

Former Member
0 Likes
1,190

Hi all,

Suppose i have very large DAT file. My requirement is to Splitt the DAT file into n number of smaller dat files. How to do this . Send me if you have any code which performs the above task .

Thanks in Advance

Krish...

2 REPLIES 2
Read only

Former Member
0 Likes
524

HI Krish,

Check

Regards,

Santosh

Read only

Former Member
0 Likes
524

Hi Krish

I guess you are referring to file on application server.

Below are the assumptions:

1. Upload data to an internal table say itab.

2. Original filename is fname.

3. No. of records to be in a file: 10.

Below code might give you some idea:

data: rec type i value 10,
      count type i value 1,
      file_ext type i value 1.
data: fname type rlgrap-filename,
      fname_ext type rlgrap-filename.

loop at itab.
     if count = rec or count = 1.
        close dataset fname_ext.
        fname_ext = file_ext.
        concatenate fname fname_ext into fname_ext.
        open dataset fname_ext for output in text mode encoding default.
        count = 1.
     endif.
     transfer itab to fname_ext.
     count = count + 1.
endloop.

Kind Regards

Eswar