cancel
Showing results for 
Search instead for 
Did you mean: 

Move DBF file after processing by Receiver JDBC adapter

Former Member
0 Kudos

Hello, experts!

I place DBF file to the folder on XI server. The file should be moved from this folder to another folder after processing by Receiver JDBC adapter.

For this purpose I tried to use Command Line parameter of Receiver JDBC Adapter to run script for moving the file.

My Command Line to run the script is:

some_path/archive/arch %f

The script is (OS Solaris):

#!usr/bin/bash

set -x

mv some_path/$ some_path/archive/$ > some_path/archive/arch.log 2>&1

But in the log file I get the following error: "mv: cannot access some_path/%f".

Can we use %f variable to transfere actual file name of the processed file to the script like for File adapter?

Please, suggest!

BR,

Vika

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

So i suggest you to try several variants:

I suppose that your scenario is File(not ftp)2JDBC.

1. Try to use archive mode of file adapter instead of OS command.

2. Try to use your script in Sender File adapter instead of Receiver JDBC adapter because JDBC adapter works with data from file and not with file directly (maybe the reason why substitution %f doesn't work in your case). Run in "Run OS command after message processing" block.

3. Try to use direct command in XI adapter without script something like /usr/bin/mv %F some_path/archive/%f > some_path/archive/arch.log 2>&1

BR,

Dzmitry

Former Member
0 Kudos

My scenario is: File - JDBC - File.

XI checks the appearance of DBF file in the folder by means of Sender File adapter (Test mode). Then if file is in the folder XI Receiver Adapter reads the content (XML SQL SELECT) of the DBF file. Next processed DBF file have to be moved to the archive folder.

Then XI transforms message and with Receiver File adapter puts it to some other folder for the next processing.

We don't use Sender JDBC Adapter instead of Sender File + Receiver JDBC because after we move processed DBF from folder, Sender JDBC doesn't find the DBF (base) and returns an error each time it tries to process the query.

Scripts called without external parameters work fine. So I guess we can't use %f and %F variables in Command Line for JDBC adapter, though I haven't met any mentioning about it.

If somebody can explain it I would appreciate.

BR,

Vika

Answers (3)

Answers (3)

Former Member
0 Kudos

Hello, one more time

Scripts called without external parameters work fine. So I guess we can't use %f and %F variables in Command Line for JDBC adapter, though I haven't met any mentioning about it.

Unfortunately, yes,i realize that we cann't use %f in JDBC adapter only in File adapter.

My solution is:

In File Sender adapter with help of OS command copy (not move) file to the archive folder.

Processing in JDBC receiver adapter.

And in Receiver File adapter with help of OS command delete any files with dbf extention from source of *.dbf files(directory which we use in sender file adapter).

BR,

Dzmitry

Former Member
0 Kudos

Hello, Dzmitry!

I did what I needed in another way (I call script which moves all DBF files from the folder to archive), but still thanks for your suggestions.

BR,

Vika

Edited by: Viktoria Demina on Nov 3, 2009 8:56 AM

Former Member
0 Kudos

And of course check with your basis team permissions for this directory and file (the best variant 777 and 666 ). Command in OS command block of your receiver JDBC adapter execute from <XI_SID>adm user.

BR,

Dzmitry

Former Member
0 Kudos

Hi, Dzmitry!

According to help.sap.com %f variable it's for file name and %F is for absolute file name including path. So I used %f.

The DBF file is processed by the adapter. Does it mean that the permissions are ok?

The error which my script writes to the log file is "mv: cannot access some_path/%f", so it looks like the %f variable is not replaced by the current file name. What I missed?

Please, clarify the question to me.

BR,

Vika

Edited by: Viktoria Demina on Nov 2, 2009 11:05 AM

Former Member
0 Kudos

Hello, Vika!

Try to use in your script %F instead of %f, because as i understand you need only file name without path.

BR,

Dzmitry