If there is a file that contains 1000 records, I need the ouput to contain these 1000 records with the header as file name concatenated with the current timestamp and trailer as the count of records

Answer Posted / raj

Method 1:
In Order to get this , the file name has to be parameterized.
Row Generator ->
Source -> Column Generator -> Funnel -> Destination
Aggregator ->
Column Generator:
Create column named 'Count' starting with 1 and incrementing by 1. By this, the last row will have the value of1000 in the 'Count' column.

Aggregator:
Get max of count which is 1000.

We also pass the actual data through another link.

Aggregator count is passed into funnel which is the trailer count.

The three inputs
1. File name concatenated with timestamp is passed from row generator.
2. Actual data is passed directly after column generator.
3. Header count is passed through the third link.

are joined in a funnel stage.

As funnel needs same number of columns across all the input we set all other columns as NULL.


Method 2...

This is an easy method using after job sub routine.

After the job is complete run a after job sub routine to get record count from any link and append to the file

Similar operation could be done for the header record.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are stage variables?

631


What are the repository tables in datastage?

817


What are the different kinds of views available in a datastage director?

595


How can you write parallel routines in datastage PX?

611


Explain usage analysis in datastage?

644






What are the main differences you have observed between 7.x and 8.x version of datastage?

618


How many types of sorting methods are available in datastage?

626


How do you import and export the datastage jobs?

730


Describe the main features of datastage?

650


How do u convert the columns to rows in datastage?

687


What is the method of removing duplicates, without the remove duplicate stage?

576


How we can covert server job to a parallel job?

591


There are two file are there .1st file contains 5 records and 2nd file contain 10 records in target they want 50 records.how can achieve this

1798


Differentiate between Symmetric Multiprocessing and Massive Parallel Processing?

614


What is datastage?

645