Is there any way to overwrite the parameter with row values?

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

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

Post by ray.wurlod »

Assuming your data are sorted appropriately use an Aggregator stage to specify "Last" of each group, grouped by order_id. THEN use a Folder stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

That's the problem, they want all records for the key to be written to the same file, not just the last one which is what they are currently getting via the Folder stage. I thought the Folder did all records automatically, so either there's a bug in their version, it has somehow been implemented incorrectly or I'm completely wrong in my recollection. :?

Worst case, you may need to write them all out to a single file and then split them up in some sort of scripted post process (csplit comes to mind on UNIX), that or (if you have the skillz) you could write a BASIC routine to do that. It could open the original file, read the records, name the output file based on a column name and close / reopen the output file whenever that values changes.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

So, folder stage files should include all the rows for that key. Right?
If this is a bug in this 7.5 version, how about in version 8 as I have plan to upgrade our existing version to version 8.
I never have this BASIC routine but I will try it :(
Or do we have any way to use the FileName that I read from folder stage as my output file name in the same job???
For example:

ODBC stage ->Transformer -> Folder -> Tranasformer-> Sequential File

Sequential File name will get from Folder stage File name.

Is it possible???

Thank you so much for your time,
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I believe it should, no-one has contradicted that yet but you really should be reporting / confirming this with your official support provider - both for your current version and any future versions. Horse's mouth and all that.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

Yes. Will do. Thank you for your advise.

chulett wrote:I believe it should, no-one has contradicted that yet but you really should be reporting / confirming this with your official support provider - both for your current version and any future versions. Horse's mouth and all that.
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

Dear All,

My problem has been solved by writing BASIC routine function in order to write all the records for spcific order file.
Thank you so much for all of your participating, time and effort to help me :-)


Thank u,
ICE

chulett wrote:That's the problem, they want all records for the key to be written to the same file, not just the last one which is what they are currently getting via the Folder stage. I thought the Folder did all records automatically, so either there's a bug in their version, it has somehow been implemented incorrectly or I'm completely wrong in my recollection. :?

Worst case, you may need to write them all out to a single file and then split them up in some sort of scripted post process (csplit comes to mind on UNIX), that or (if you have the skillz) you could write a BASIC routine to do that. It could open the original file, read the records, name the output file based on a column name and close / reopen the output file whenever that values changes.
Post Reply