Application Development 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: 

OPEN DATASET still opens file when file is being FTP'd .. ie. being written to disk..

david_rosen1
Discoverer
0 Kudos
428

It has come to our attention that the OPEN DATASET command will open a file without error (and therefore allow reading of the records in the file ..) even when the file is in the process of being Ftp'd to the input/source directory.  This is resulting in partially read files.  Does anyone know how we can "check" (we were hoping the OPEN DATASET command would return an error if the file was not fully written ..) if a file is in the process of being written so we don't start reading/processing the file ?

Thanks


David

3 REPLIES 3

Former Member
0 Kudos
115

Hi David

Depends on the process in place, but typically what we do is while the copy of the file is in progress. Set File Suffix as ".Copy", once the file transfer is complete change the File Name from "Copy" to ".Ready".

Not sure if you're able to implement similar functionality

Regards

Arden

0 Kudos
115

Hi David

If your issue has been resolved, please mark the thread as answered.

Regards

Arden

Mohamed_Mukhtar
Active Contributor
0 Kudos
115

Hi ,

Try with FM TXW_DATA_FILE_ENQUEUE to enqueue file and set Lock_MODE as 'S'. (It will stop read access) before writing the file to Al11.

Use FM TXW_DATA_FILE_DEQUEUE after the file is completely written.

Thanks

-Always Learner