Retrieve last row from sequential file

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
newtods
Participant
Posts: 7
Joined: Thu Jan 02, 2003 12:55 pm

Retrieve last row from sequential file

Post by newtods »

I have a reference table on Oracle with two columns: values defined in column A should be converted to values defined in column B. Through my transformer, I need to accumulate this data into one sequential file in the following format:
A=B|A1=B1|A2=B2| and so on.
I am expecting to receive one row of data in my sequential file. Instead, I receive the following:
Row 1: empty
Row 2: A=B
Row 3: A=B|A1=B1
Row 4: A=B|A1=B1|A2=B2
and so on.
How do I retrieve the last row from this sequential file which should have all values from reference table in one row?

Thank you in advance for your answers.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It appears that you are successfully generating what you want, but writing it for every input row rather than just for the final row.
There are a few ways to achieve your desired result; probably the easiest is to run your (single column) output into an Aggregator stage grouping on "Last".
newtods
Participant
Posts: 7
Joined: Thu Jan 02, 2003 12:55 pm

Post by newtods »

It appears that you are successfully generating what you want, but writing it for every input row rather than just for the final row.
There are a few ways to achieve your desired result; probably the easiest is to run your (single column) output into an Aggregator stage grouping on "Last".
I've never used Aggregator stage before but managed to compose a job. Now, when I run the job, I receive the following error:
"VikTest4Agreg..AGGREGATOR5: While creating "DSColumnC" object of type ""
NLS map "" not loaded"

What have I done wrong?

Please help. Do not ignore my message.

Thank you for all your help.
newtods
Participant
Posts: 7
Joined: Thu Jan 02, 2003 12:55 pm

Post by newtods »

It appears that you are successfully generating what you want, but writing it for every input row rather than just for the final row.
There are a few ways to achieve your desired result; probably the easiest is to run your (single column) output into an Aggregator stage grouping on "Last".
I've never used Aggregator stage before but managed to compose a job. Now, when I run the job, I receive the following error:
"VikTest4Agreg..AGGREGATOR5: While creating "DSColumnC" object of type ""
NLS map "" not loaded"

What have I done wrong?

Please help. Do not ignore my message.

Thank you for all your help.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

It appears that you are using DataStage with NLS enabled, but have not specified a character map for the Aggregator stage (NLS tab on stage properties). However, this should default to the map defined for the job.
The other possibility is that you have a different number of columns on the output link than you have on the input link, or have omitted one or more derivations on the output link.
Without actually seeing the job it is difficult to assess.
newtods
Participant
Posts: 7
Joined: Thu Jan 02, 2003 12:55 pm

Post by newtods »

It appears that you are using DataStage with NLS enabled, but have not specified a character map for the Aggregator stage (NLS tab on stage properties). However, this should default to the map defined for the job.
The other possibility is that you have a different number of columns on the output link than you have on the input link, or have omitted one or more derivations on the output link.
Without actually seeing the job it is difficult to assess.
Dear Ray,

There is no NLS tab on Aggregator stage (at least in my case) and the number of columns is the same for input and output in the Aggregator stage.

Do you have any other suggestions?

Thank you.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

What are the NLS character map and locale settings for your job?
Check (using the Administrator client) that these are actually loaded. The error message suggests that one (at least) is not loaded. If you find that this is so, use the Administrator client to load it. You will have to re-start the DataStage server for the load to take effect.

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
newtods
Participant
Posts: 7
Joined: Thu Jan 02, 2003 12:55 pm

Post by newtods »

What are the NLS character map and locale settings for your job?
Check (using the Administrator client) that these are actually loaded. The error message suggests that one (at least) is not loaded. If you find that this is so, use the Administrator client to load it. You will have to re-start the DataStage server for the load to take effect.

Ray Wurlod
Education and Consulting Services
ABN 57 092 448 518
Thank you, Ray.

Everything is working now. My job had NLS property set up to Project Default (NONE) that probably was not the same as "NONE". When I changed that part, everything worked the way you said.

Thanks again.
Post Reply