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

Answers were Sorted based on User's Feedback



If there is a file that contains 1000 records, I need the ouput to contain these 1000 records with t..

Answer / 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

If there is a file that contains 1000 records, I need the ouput to contain these 1000 records with t..

Answer / datastage4you

Can you let us know what you have tried?

www.datagenx.net
http://goo.gl/atN4AT

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Data Stage Interview Questions

How can we run same job in 1 day 2 times

4 Answers   IBM,


How to display errors in datastage?

1 Answers   TCS,


Whats difference betweeen operational data stage (ods) and data warehouse?

0 Answers  


Difference between IBM DATA STAGE8.5 and DATA STAGE9.1 ?

0 Answers   ABC, TCS,


How do u set a default value to a column if the column value is NULL?

7 Answers   HP,






How to convert alpha Numeric values to alpha using functions?

1 Answers   CTS,


EXPLAIN SCD

0 Answers   CTS,


how to use self join using datastage ? can u tell me using stage how can we implemnet the self join

0 Answers  


Out of 4 mill records only 3 mill records are loaded to target and then job aborted. How to load only those 1 mill(not loaded records) for next run. This job is not sequential job, it is stand alone parallel job.What are the possibilities available in datastage8.1?

7 Answers   IBM,


what is the function in Transformer stage can act as Rank function in Oracle

1 Answers   Reliance,


in oracle target stage when we use load option and when we use upsert option?

0 Answers  


Hi Friends, I have a input data like, class_id Marks 101 50 101 60 101 40 102 90 102 35 And i want my output data like class_id Marks Rank 101 50 2 101 60 1 101 40 3 102 90 1 102 35 2 how to do this in datastage?

8 Answers   Cognizant, HCL, TIAA CREF,


Categories