DataStage jobs are typically used to process data by batches, and they are scheduled to run at specific intervals. When there are no specific plans to follow, the DataStage operator can manually start the job through DataStage and Qualitystage Director clients or on the command line. If you run a job at the command line, you can execute it as follows.
Figure 1 shows a chart that represents this command.
Figure 1. Call DataStage Job
In a normal environment, in_file and Out_file are stored in a file system on a machine running DataStage. However, in Linux or UNIX, input and output can be transferred to a series of commands. For example, when a program needs to be sorted, the executable command command|sort |uniq >/path/to/out_file. In this case, Figure 2 has an explicit data flow in which the output of one command becomes the input of the next command, and the final output is in the file system.
Figure 2. Typical UNIX pipe usage
Assuming that the intermediate process generates millions of lines of code, you can avoid getting intermediate files, saving space in the file system and the time it takes to write those files. Unlike many programs or commands that are executed in UNIX, DataStage jobs do not get standard input through pipelines. This article describes a method that demonstrates how to use a script to accomplish this task and how it is actually used.
If the job should accept standard input and generate standard output, like a regular UNIX command, you must call it through a wrapper script in the following manner: Command1|piped_ds_job.sh|command2 >/path/to/out_file.
Or you may have to send the output to a file, such as using the command command1|piped_ds_job.sh >/path/to/out_file.
The diagram in Figure 3 shows how the script should be structured.
Figure 3. Wrapper script for a DataStage job
The script must convert the standard input to the specified pipe, and it must also convert the output file of the DataStage job to standard output. In the following sections, you will learn how to accomplish this task.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.