Building a Job

Published on December 2016 | Categories: Documents | Downloads: 19 | Comments: 0 | Views: 131
of 4
Download PDF   Embed   Report

Building a Job

Comments

Content

Exercise 4-1: Building a Job
Important!


Before working on the exercises, download the Exercise Files
and load them into a directory named c:\DS314SvrFiles. Click
the Exercise Files button on the Exercise page, to do this.
Note: If you are copying this directory from the CD, be sure to
remove the Read Only properties of the directory and its files.



Recommendation! Prefix the names of jobs and other objects
you create in DataStage with your initials. This will allow you
to distinguish your jobs from jobs in the Solution set with the
same names that you import for examination.



Click the Exercise Jobs button to download the jobs and other
DataStage objects in the Solution Set. You can check your
jobs against the jobs in this file. You will learn how to import
jobs from this file in Module 5. If you have trouble with
completing this exercise, go on and complete Module 5, and
then return to the exercise.

Assumptions:


There is a file named Jobs.txt in your DS314SvrFiles directory.

Task: Start Designer and attach to your project
1

Start Designer.

2

On the Attach to Project window log on to your project. The
New window is displayed.

3

Click the Server icon and then click OK to open a new Server
job.

Task: Create a job that copies data in a sequential file
Here is the summary. Detailed steps follow the summary.
In this task you create a simple job that copies a sequential file. Since
it is a straight copy you will not use a transformer stage. Here are the
details:


Job name:

JobsCopy



File to copy:

Jobs.txt



File directory:

\DS314SvrFiles

DataStage Essentials

Exercise 4-1



Name of output file:

JobsCopy.txt



Directory to copy to:

\DS314SvrFiles



Overwrite the data in the output file



Include column names in the first record (line) of the output file

Steps
1

Add the two sequential stages and the link between them.
− Give appropriate names to the stages and link

2

Open the Jobs.txt file in a text editor and determine the
following:
− Column delimiter
− Column definitions
− Does first column contain column names?

3

Define the source sequential stage.
− Use the View Data button in the stage to verify that you have
defined the data correctly.

4

Define the target sequential stage.

5

Add an Annotation stage to your job. Open the Annotation stage.
Document what your job does. Choose a suitable font and color
for the text and background.

6

Open the Property Browser window. Select each of your stages
and view the information that is displayed in the Property
Browser window.

7

Click on your link label. Add appropriate documentation in the
Property Browser window as to what is going in the link and
what is going out of the link.

2

DataStage Essentials

Exercise 4-1

8

Save your job.

9

Compile your job.

10 Move to Director from the Designer and then validate and run

your job.

− View the log events as your job runs
− Determine how many rows were copied from the Jobs.txt by
double-clicking on the events in the log and viewing the
information.
11 Go back to Designer and view the data in the output file.

Task: Create a job with a transformer
In this task you create a simple job that extracts data from the jobs.txt
file and then loads just the job IDs and descriptions into a sequential
file. Here are the details:


Job name:

JobNames



File to copy:

Jobs.txt



File directory:

\DS314SvrFiles



Name of output file:

JobNames.txt



Directory to copy to:

\DS314SvrFiles



Overwrite the data in the output file.

3

DataStage Essentials

Exercise 4-1



Exclude the column names record from the first line in the output
file.



Use the pipe (|) for the column delimiter in the output file.



In the output file, make the first column the job description and the
second column the job ID.

Steps
1

More or less the same steps as in the previous task, except that
you need to add a transformer stage and define the movement of
data from the input link to the output link.

2

To define the movement of data through the transformer, open the
transformer and drag the source columns from the upper left pane
to the upper right pane.

3

Validate and run your job. View the data in the output file after
the job runs.

4

Sponsor Documents

Or use your account on DocShare.tips

Hide

Forgot your password?

Or register your new account on DocShare.tips

Hide

Lost your password? Please enter your email address. You will receive a link to create a new password.

Back to log-in

Close