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

how can we create rank using datastage?what is the meaning of rank?

8189


Can anyone tell me a difficult situation who have handled while creating Datastage jobs?

2844


What is the difference between operational data stage (ods) and data warehouse?

675


What is Ad-Hoc access? What is the difference between Managed Query and Ad-Hoc access?

2545


what is the difference between == and eq in UNIX shell scripting?

972






In Datastage, how you can fix the truncated data error?

640


What is the difference between informatica and datastage?

658


How many types of views are there in a datastage director?

834


What a datastage macro?

638


What could be a data source system?

579


How do you reject records in a transformer?

629


What are the primary usages of datastage tool?

625


client know skid info?

1635


Hi , Can anyone give few examples of scenarios and there corresponding design in datastage..i am new to this tool...confused in design while my manager asking to design the job.. Please post the URL if there..so i can go through it.. Thanks in advance...

3759


What is the precedence of stage variables,derivations, and constraints?

600