Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 the stages in datastage?

1135


Differentiate between hash file and sequential file?

1120


Why fact table is in normal form?

1306


Why we use surrogate key?

1301


what is the use of surogate key in datastage

2363


What is a merge?

1236


Have you used Unstructured data?

1368


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

1167


What is the difference between account and directory options ?

1232


tell me 5 situations when we r using oracle db stages like orecle connector, oracle enterprise

3181


What are stage variables and constants?

1193


What is "fatal error/rdbms code 3996" error?

1341


1.new record it will insert but changes of natural key is not present in taget i want to update (here key is composite natural key )can any one help this to explan how to do

2137


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

1073


Nls stands for what in datastage?

1230