Page 1 of 1

Command Stage

Posted: Thu May 07, 2015 9:37 pm
by wittyme
Recently I had an issue with using Cat command in datastage which triggered me this question.

Our datastage server is installed on Linux.

We can use unix commands in command stage right? Does it work exactly as commands written on Unix box.

We can only write one line commands, right?

The below information is what I found on IBM Knowledge Center

Using Commands

You can execute any command, including its arguments, that you can execute from the Windows command window. Examples include Perl scripts, DOS batch files, and other command-line driven programs that are not interactive or do not request input.



The issue I had with CAT command is I am trying to append five files in a directory to a new file.

For example:

cat /a/file1.txt /a/file2.txt /a/file3.txt /a/file4.txt /a/file5.txt > /a/file.txt

Some how file2.txt is not coming in output. I interchanged the files and whatever repeating in second position is not appending in output.

I tried creating a dummy file and put it in second position and it still didn't work. I reached out for help in other unix and linux forums and didn't got any other useful commands.

Posted: Fri May 08, 2015 7:08 am
by chulett
:idea: Your post has the OS marked as Windows, you should in the future put 'Unix' there as it denotes the server operating system.

You mean the Execute Command stage, correct? There is actually a Command stage but it only exists if your server is on Windows and that is what you found the documentation for. Otherwise yes, 'one line' O/S commands. Out of curiosity, does this work for you instead?

Code: Select all

cd /a && cat file1.txt file2.txt file3.txt file4.txt file5.txt > file.txt