cancel
Showing results for 
Search instead for 
Did you mean: 

OS Command to ensure that the File Adapter only processes completely writte

former_member859847
Active Contributor
0 Kudos

Hi Experts,

i want to cutomize the file adapter to process the completly written files at FTP location, can any body provide OS level script(Unix) to resolve the issue, pls check the below steps which may help out.

the following algorithm (to be implemented in my application) in order to ensure that the File Adapter only processes completely written files:

Create the file using an extension, which does not get processed by the File Adapter, e.g., ".tmp"

Write the file content

Rename the file to its final name, so the File Adapter will notice its existence and pick it up.

warm regards

Mahesh.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Mahesh,

Your algorithm need to be used at Source end. so if Sender is generating the file, it need to use temporay file name while writing the file & after completion, it should be renamed. PI can not do anything there.

If PI is generating file for target, then in receiver file channel, setting is already available which indicate use temporary file name.

Regards

Sushil

Former Member
0 Kudos

There is another option.....

a parameter that can be set on the file adapter (depending on your version)

Advanced Mode

To specify additional parameters in the adapter configuration, set the Advanced Modeindicator.

● Msecs to Wait Before Modification Check

Enter the number of milliseconds that the adapter must wait before it checks whether the files have been changed.

This parameter is not available if you have selected File Content Conversion as the Message Protocoland then made an entry under Recordsets per Message that splits an input file into several messages.

This parameter is applicable only for the File adapter. If you enter a value in this field when configuring the sender FTP adapter, it will have no effect.

basically this then checks that the file has not been updated for the n entered before processing the file

prateek
Active Contributor
0 Kudos

Which PI version are you using. In the advanced mode of file channel, you may use option "Msecs to Wait Before Modification Check".

Regards,

Prateek

former_member859847
Active Contributor
0 Kudos

Hi Prattek,

Can you pls confirm this option will work for File transfer protocl(FTP).i think this applicable for NFS.

warm regards

Mahesh.

Former Member
0 Kudos

i do not have the correct version of PI on this project to do this for you.

try in your Dev system and find out.... the proof is in the testing!

you should confirm yourself and not just take our word for it!

it maybe that this option is not a solution to your issue!

and you may not have the right version of PI either!

former_member859847
Active Contributor
0 Kudos

Hi Neaves,

i am using PI 7.0 version with SP-15, i tested the scenario by mantaining above parameter.still i am facing the problem.

can you pls confirm this option will work above version.

warm regards

Mahesh.

Former Member
0 Kudos

What value have you set? i set something like 45000 and it worked for me.

i was using it on NFS but it should work too for FTP!

my experience is detailed here:

former_member859847
Active Contributor
0 Kudos

Hi Neaves,

i have set "600000"as value for Msec to wait befor modification check,this is an interface rom BW->XI->ECC.

BW will send files having size in MB, it will take approximately 4 to 5 min to writeen complete data file in the FTP location.

i set the poll interval as-200sec, but still i am facing the error as below.

Could not process due to error: com.sap.aii.adapter.file.ftp.FTPEx: 450 zohd_oi.aa: Cannot open or remove a file containing a running program.

can you please let me know, how to resolve this issue.

warm Regards

Mahesh.

prateek
Active Contributor
0 Kudos

This doesn't work with FTP.

Regards,

Prateek

former_member859847
Active Contributor
0 Kudos

Hi Prateek,

Can you please guide me any other option will avialable to resolve the below issue.

warm regards

Mahesh.

Former Member
0 Kudos

Hi Mahesh,

you can use end-of-job files to indicate that transmission has finished. Just transfer the data file lets say example.dat and after it has been successfully transfered send an empty file named example.eoj. Then give the option additional file(s) in the file sender adapter with

filename: eoj

and parameters

eoj.namePart=".dat"=".eoj"

eoj.optional=NO

see http://help.sap.com/SAPHELP_NWPI71/helpdata/en/44/692ab8a4b633eae10000000a1553f6/content.htm