Command Stage

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
wittyme
Premium Member
Premium Member
Posts: 151
Joined: Tue Sep 15, 2009 2:03 pm
Location: Chicago

Command Stage

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply