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: 

Problem with Deleting File in Application Server

Former Member
0 Kudos
145

Hi,

I have a program which downloads my file into application server. And my file name is something like "SUCC_PROD_CAT.DAT". This file is used by some other external application.

Even before the file gets downloaded fully, this external application is trying to access the file and this result in Partial file access or file with no records. This happens when the file size is large.

Inorder to aviod this problem, i am downloading my file in a temporary file name called "TS_PROD_CAT.DAT" and when the download is over, i am renaming it to "SUCC_PROD_CAT.DAT" using some command line operation. It gets renamed and after a couple of minutes, both the file Viz., TS_PROD_CAT.DAT and SUCC_PROD_CAT.DAT comes in the application server.

Even i have tried some other command line operation like Copying the File into SUCC_PROD_CAT.DAT and then deleting the temporary file TS_PROD_CAT.DAT. Even in this case, after a couple of minutes, the temporary file TS_PROD_CAT.DAT is getting restored.

Whether i need to do some other thing, in such a way that, temporary file should not get restored, after processing is over?

Thanks and Regards,

Vijay Govindarajan

3 REPLIES 3

Former Member
0 Kudos
81

Use FM

EPS_DELETE_FILE or CONVT_DELETE_FILES

to delete file or you can use

DELETE DATASET

statement.

rgds,

TM.

Please mark points if helpful.

Former Member
0 Kudos
81

You can declare 2 directories in your application server:

1. Tobeuploaded

2. Uploaded

Instead of deleting or renaming the file after uploading, move it to the directory uploaded. Sometimes the problem lies with authorization in the application server.

Former Member
0 Kudos
81

Hello Vijay,

As inidcated by you there is no reason for the file to reappear. Are you using shell cmds to copy the file? If yes then u can try to rename the file and move it into another directory say archive which can be deleted later on using another shell.