Flatfile Issue

Hello All,

We are loading 2.4 million of data for every 5 minutes for one of our real time application. we need to generate files in ( A folder) and need to transfer the files to (B folder), Everthing is running fine , But once or twice in a day job is failing to move files from (Folder A to Folder B) after next run ( after 5 min)job is running fine Below is the error .
When we have check with network team they say everything is fine on network side. Really don`t know what is the root cause.

(14.2) 03-12-18 15:40:57 (E) (13484:21404) FIL-080146: Cannot move file <\XXY\EEE_DATA_SSS\FLATFILES\ABC.txt>. Additional information: .
(14.2) 03-12-18 15:40:57 (E) (13484:21404) FIL-080146: Cannot move file <\XXY\EEE_DATA_SSS\FLATFILES\ABC.txt>. Additional information: .
(14.2) 03-12-18 15:40:57 (E) (13484:21404) RUN-050316: |Session TEMP_ABC_XYZ
File move failed for ABC.txt file.
(14.2) 03-12-18 15:40:57 (E) (13484:21404) RUN-050304: |Session TEMP_ABC_XYZ
Function call <raise_exception ( File move failed for ABC.txt file. ) > failed, due to error <50316>: .
:hb: :hb: :hb:


vinay.sapds (BOB member since 2011-05-16)

Sometimes this may happen when the files in folders A or B are open when SAP DS trying to move the files. Please make sure that no one is opening the files when the job is running.


niranjan479 :india: (BOB member since 2014-01-08)

Yu may want to dynamically name the file with the date and time as part of the file name. This would eliminate such an issue from occurring.


klynch0323 (BOB member since 2018-08-20)

I see this happen a lot more than I like. DS will start the next process on a file without it being closed, or the task being completed.

I attribute this to the file system being too busy, and usually this happens when looping through a lot of files but it can happen any time. (loops increase the odds)

If you use python at all …

def is_open(filename):
    from ctypes import cdll
    _sopen = cdll.msvcrt._sopen
    _close = cdll.msvcrt._close
    _SH_DENYRW = 0x10
    import os
    if not os.access(filename, os.F_OK):
        return False # file doesn't exist
    h = _sopen(filename, 0, _SH_DENYRW, 0)
    if h == 3:
        _close(h)
        return False # file is not opened by anyone else
    return True # file is already open

I’ve gotten to the point where I have to put sleep(5000) functions before these moves. I have not updated everything with the Python is_open check yet.


jlynn73 :us: (BOB member since 2009-10-27)