Start Loop in DS7.1
Moderators: chulett, rschirm, roy
Start Loop in DS7.1
Hi We are using Datastage 7.1r1.
I did not find Start Lopp activity and End Loop activity in Sequence Job.
Please let me know whether the stage is available in DS7.1V
If not what is the alternate option.
I did not find Start Lopp activity and End Loop activity in Sequence Job.
Please let me know whether the stage is available in DS7.1V
If not what is the alternate option.
Thanks,
Madhavi
Madhavi
I already posted a query sometime back on taking the inputs from an excel.DSguru2B wrote:Maybe write your own job control
U suggested me to load the data into hash file. I loaded the data into the hashed file and I wrote a routine to call the UtilityHashLookup which in turn fetches the required value from the hashed file.
The userdefiend routine looks as:
----------------------------------------
$INCLUDE DSINCLUDE JOBCONTROL.H
DEFFUN UtilityHashLookup(Arg1, Arg2, Arg3) CALLING "DSX.UTILITYHASHLOOKUP"
* NOTE The routines catalog name is in all upper case!
Ans = UtilityHashLookup(Arg1, Arg2, Arg3)
----------------------------------------------------------
e.g MatterNumber is the input value from excel or csv. I have another column called Key whose value is auto generated for every input, which is the key column in the hashed file.
Test1:
I gave Arg1: Hashed file name
Arg2: 'Key'
Arg3:1
If i generate a new key for every input value loaded to the hashed file , then i am not able to use the key column name as the second arguement for the UtilityHashLookup. Its throwing RECORD NOT FOUND error.
Test2:
I gave Arg1: Hashed file name
Arg2: Key Value
Arg3:1
If I assign a constant as key, then the hashed file is getting loaded with one only value.
And I am able to retrieve the matternumber if I hardcode the key value.
Can we pass the key value at run time ?
Otherwise suggest me if I can take one value at a time from the excel and load it to the hashed file.
Thanks,
Madhavi
Madhavi
pls check the below given linkDSguru2B wrote:I vaguely remember the post you are mentioning. Can you kindly provide me the link to that post so that i can refresh my memory and help you.
http://dsxchange.com/viewtopic.php?t=10 ... 0e48a6d878
Thanks,
Madhavi
Madhavi
That post was different as mahi_mahi needed to run a second job with each value read from a csv file in the first job. I asked him to load the csv file into a hashed file with an extra column that would be the key a running number incremented sequentially, which will also be the invocation id for the multiinstance job. This way it will stay dynamic and nothing needs to be hardcoded.
I think your requirement is different.
You need to loop in the job control depending on your requirement.
I think your requirement is different.
You need to loop in the job control depending on your requirement.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
My friend has posted the query for me.
It's the same requirement. I am still working on it.
I need to take input from an excel and run a set of jobs in sequnce.All the jobs need the same input to be passed. For which u suggested me to load the input to a hashed file first and then Use UtilityHashLookup to retrieve data from the hashed file.
I did the same way. I added one more column which is key column and the value of the key column is auto generated.
But I dont know how to get one value at a time out of the hashed file and pass it as a parameter to the next set of jobs.
I did not understand the Invocation ID concept. Please help me out.
Ans as mentioed in the above postings, I dont know how to genearlise the Key value and pass it to the UtilityHashLookup.
Please correct me if I am wrong:
I feel I will use a sequence job for all the dependent jobs.(1st job)
I will have another sequence job where in I call the hashedfile from the routine activity stage to get the parameter and pass it onto the sequence job in the second step.
I hope I am bugging you guys. Please bear me.
It's the same requirement. I am still working on it.
I need to take input from an excel and run a set of jobs in sequnce.All the jobs need the same input to be passed. For which u suggested me to load the input to a hashed file first and then Use UtilityHashLookup to retrieve data from the hashed file.
I did the same way. I added one more column which is key column and the value of the key column is auto generated.
But I dont know how to get one value at a time out of the hashed file and pass it as a parameter to the next set of jobs.
I did not understand the Invocation ID concept. Please help me out.
Ans as mentioed in the above postings, I dont know how to genearlise the Key value and pass it to the UtilityHashLookup.
Please correct me if I am wrong:
I feel I will use a sequence job for all the dependent jobs.(1st job)
I will have another sequence job where in I call the hashedfile from the routine activity stage to get the parameter and pass it onto the sequence job in the second step.
I hope I am bugging you guys. Please bear me.
Thanks,
Madhavi
Madhavi
You mean not bugging us
You are not.
The invocation ids come into existence when you make a job multi-instance. You can run several instances of a particular job at the same time which is distinguished from one another on invocation id.
I suggested to your friend in my other post to use the invocation id as the key to the lookup.
Say for example you are running the first instance, in the invocation id box you will give 1, for
UtilityHashLookup(hashedfilename,#InvocationId#,columnNumber)
Call this in the derivation of the job parameter that you need to pass to the other jobs.
In the job activity, you will find job parameters to which you have to assign an expression, click on that box, when it expands, right click, go to routines, sdk, utility, you will find the UtilityHashLookup() routine right there. Dont use it in routine activity.
Search the forum on how to make a job multiinstance.
![Wink :wink:](./images/smilies/icon_wink.gif)
You are not.
The invocation ids come into existence when you make a job multi-instance. You can run several instances of a particular job at the same time which is distinguished from one another on invocation id.
I suggested to your friend in my other post to use the invocation id as the key to the lookup.
Say for example you are running the first instance, in the invocation id box you will give 1, for
UtilityHashLookup(hashedfilename,#InvocationId#,columnNumber)
Call this in the derivation of the job parameter that you need to pass to the other jobs.
In the job activity, you will find job parameters to which you have to assign an expression, click on that box, when it expands, right click, go to routines, sdk, utility, you will find the UtilityHashLookup() routine right there. Dont use it in routine activity.
Search the forum on how to make a job multiinstance.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.