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 is "fatal error/rdbms code 3996" error?

663


What is the difference between odbc and drs stage?

637


What are some prerequisites for datastage?

615


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

598


How to reverse the string using SQL?

889






What are the different options associated with dsjob command?

935


how to read 100 records at a time in source a) hw is it fr metadata Same and b) if metadata is nt same?

1715


What are the important features of datastage?

616


Hi,can any one please mention list of dimension and fact tables for Sales and Distribution System for a Pharmacutical company.

1665


What is the difference between an operational datastage and a data warehouse?

628


What is the difference between server job and parallel jobs?

662


How can one find bugs in job sequence?

780


What are orabulk and bcp stages?

645


How many types of stage?

673


1)How will u implement SCD2 by using surrogate key. 2)What are the disadvantages with surrogate key. 3)How will you handle nulls in your project for the varchar, integer data types. 4)Can I use two fact tables in star schema. 5)3 jobs are running on the 2 nodes after I added one more node so can I compile those jobs to run on three nodes.

3501