on 11-02-2009 8:08 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.