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

ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

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

Post by ICE »

Dear All,

Is there any way to overwrite the parameter with row values?
For example: Job parameter vndemail=123@abc.com

row value ->
vndA,vndAemail@123.com
vndB,vndBemail@456.com
vndC,vndCemail@123.com
.
.
.

I would like to overwrite the value of vndemail=123@abc.com with vndAemail@123.com when reading the first row and send email to vndAemail@123.com and when 2nd row and 3rd row reading, I would also like to overwrite the value of vndemail with respective values and send email to respective email which get it from vndemail parameter.

Do you think it can be done in Datastage Server job or Sequencer job???


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

Post by ray.wurlod »

Not possible legally. Parameter values are read into memory when the job is started.

If you're not interested in "legally", search DSXchange for references to STAGECOM.ARR.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

In order to keep it simple without manipulating parameters, you can use following methods.

One method will be to call the sendmail utility in a loop - once for each line.

Did you look into sendmail script ?

You can invoke it from your transformer using OS calls.
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

Dear Ray,

Ok. I will find it although I do not know what is STAGECOM.ARR.
Is it possible to explain little bit about STAGECOM.ARR???
I am so sorry for my poor knowledge:(


Thank you so much for your time,
ICE
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

The STAGECOM.ARR values are not documented and, as Ray has pointed out, there is no official way to do this. Manipulating the STAGECOM.ARR takes some knowledge of the internals of DataStage. I would go the path that Sainath has recommended and use explicit calls from your transform stage to the sendmail script with row data. That is documented, legal and supportable.
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

Dear ArndW and Saint,

Yeah I really want to use it but my actual rows will be as below.

Order_id, SKU, VndNo,Qty, Price...
001,10001,100,10,10
001,10002,100,10,10
001,10003,100,20,20
002,10001,101,12,12
.
.
.

Then I want to send order no 001 to respective VndNo 100's email. So I want to check the next row's Order_id is same order_id or not. Hence I would like to reset the parameter value with previous row's Order_id to check whether it is same order_id or not.
I am so sorry for my poor example from my first post:(

Is there any idea please???


Thank you so much for your time,
ICE
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

That is different from what you mentioned before.

You can split the data into separate files based on the recipient mail id. After this job, you can browse through the directory and send each file to intended recipient.

PS : Thanks for making me a Saint.
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

Dear Sainath,

Yes. I am so sorry that I gave poor example and made misunderstanding :(
Yes. I also want to split the files according to Order_id but I don't know how to split the rows by grouping order_id such as

001,10001,100,10,10
001,10002,100,10,10
001,10003,100,20,20

I want all the above 3 rows to be in order_id=001 file and etc.
Is there any idea how can I split it please???


Thank you,
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Do you have PX installed ? Reason for this question is that I can give you easy solutions in Unix than in Windows.

In Windows, you can create a unique list of values by passing the data through an aggregator and writing to a separate file. This file can be used in a loop to locate, prepare and email the records from your current output.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Write the files out using a Folder stage, it will create data-driven separate files for you automatically if you set it up properly.
-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 »

Nope. Mine is 7.5 Window version :(
May I know how to create unique list of value? Do you think it can be solved as my requirement include duplicate order-id with diff sku?

Thank you so much for your time,

Sainath.Srinivasan wrote:Do you have PX installed ? Reason for this question is that I can give you easy solutions in Unix than in Windows.

In Windows, you can create a unique list of values by passing the data through an ...
ICE
Participant
Posts: 249
Joined: Tue Oct 25, 2005 12:15 am

Post by ICE »

I have already tried with folder stage but it could solve only 50% of my requirement. Using Folder stage, files could be created according to Order_id but the problem is the generated file can keep only the last rows of the specific order_id :(
Actually there should hav more than one rows in the file.

For example:

Order_id,SKU, VendNo,price, qty
001,10001,100,10,10
001,10002,100,10,10
001,10003,100,20,20

File created as 001 for Order_id 001 but it include only the last row which is for sku 10003 as follows.

001,10003,100,20,20

It seems like overwrite.
Is there any way to append the rows in folder stage file creation?

Thank you so much for your time,


chulett wrote:Write the files out using a Folder stage, it will create data-driven separate files for you automatically if you set it up properly. ...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

I don't recall having any such problem, it should continue to write out all records to your target until the field controlling the name changes. You are sorting the data first by order_id, yes?
-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 »

Really?Do you mean, the output file should have all the records for that specific order_id?
But my output order files include only one last record for that specific order_id :(
Yes. I sorted by Order_id.
Is there any idea please???



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 »

As I said, I don't recall that being a restriction and unfortunately I have no way to run my own tests anymore. And the documentation is a little sparse on the subject, so I'm afraid others will have to actually help you with this. That or ask your official support provider. Sorry.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply