XI: Operation system command – error catching
There’ve been many posts on the XI forum
where some of you where asking why your OS command
doesn’t get executed inside your Adapter and you don’t know what’s wrong.
I decided to check if there’s any simple way of dealing with this problem 🙂
Here’s my solution:
Once you set your communication channel (in my case it’s file/ftp)
you can set it to store the file on the File system (Transport Protocol).
Then you set target directory on the Server and the filename
Now the fun part:)
If your command isn’t executing correctly you can easily
store the error message in any file you want.
In my example I’m using the same folder as the one in which
I store my XML files from the Receiver adapter.
As you can see I execute a non existing command “echooo”
When I run my scenario apart from the XML file I can find
demo1.txt file with the descripion of the error :
‘echooo’ is not recognized as an internal or external command,
operable program or batch file.
I was working in the Windows NT environment (server)
but this should also be possible on Unix systems
I hope this little “trick” will be helpful to some of you.


Good trick, pretty useful, but do you have any idea how to use the trick in AS/400. I have to call a library program in AS/400 like
CALL PRGM(STDSAPOUT) PARAM('file.txt'). This command triggers a job in AS/400. but it is not triggering anything.
Thanks in advance.
Sujan
sorry don't know as/400...
but maybe you can ask your basis team?
Regards,
michal
you shouldent have to do that, See if you have PASE for i5, then run the command from QSH...
Regards
Ravi Raman
check installed pgms..look for i5 PASE..which is the aix toolkit for as400.
Then run the command as a qsh command,
QSH runCommand.sh
Regards
Ravi Raman
only use this "command processing" with an script file
i tried to put the following command into the before message processing command line:
"copy /XI/ECHtoSAP/ELEC/%f /XI/ECHtoSAP/MECOM/%f"
But the result is as follows:
Error when executing OS command "copy /XI/ECHtoSAP/ELEC/MEC_ECH210_20070710_126757625.dat /XI/ECHtoSAP/MECOM/MEC_ECH210_20070710_126757625.dat"
The transport protocol is FTP.
Is it possible to copy the file before it is processed by the fileadapter?
Thanks for a quick answer
regards Marlies
check installed pgms..look for i5 PASE..which is the aix toolkit for as400.
Then run the command as a qsh command,
QSH runCommand.sh
Regards
Ravi Raman
Thank you so much for this small but wonderful idea on catching errors when executing the command.
This helped me to find out the script issues easily.
Michael-
Hope all is well:)
I am using command line in PI to zip all the files in a given folder. PI is running on ORACLE Database. The OS command is not executing at all. I have used your trick to write an error long and also have used wrong command so that it would error out in channel and nothing is happening. In communication channel log it says OS command executed. I am thinking if there are any configuration missing during PI install to execute OS command. Please throw some taughts. You can find my dissucssion here: Command Line is not executing using File Adpater
Please let me know.
Regards
HS
Nice blog, waiting for more from you