Start Loop in DS7.1

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

pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Start Loop in DS7.1

Post by pmadhavi »

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.
Thanks,
Madhavi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

It is not available until the 7.5.x releases.
-craig

"You can never have too many knives" -- Logan Nine Fingers
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

chulett wrote:It is not available until the 7.5.x releases. ...
Please suggest me how to implement Loop in a sequence job in DS7.1
Thanks,
Madhavi
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Maybe write your own job control :?
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

DSguru2B wrote:Maybe write your own job control :?
I already posted a query sometime back on taking the inputs from an excel.

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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

pmadhavi wrote:
chulett wrote:It is not available until the 7.5.x releases. ...
Please suggest me how to implement Loop in a sequence job in DS7.1
Upgrade? :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

DSguru2B 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.
pls check the below given link
http://dsxchange.com/viewtopic.php?t=10 ... 0e48a6d878
Thanks,
Madhavi
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

That link is not working. Its taking me to a login page and once i login, it dosnt show the topic.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

DSguru2B wrote:That link is not working. Its taking me to a login page and once i login, it dosnt show the topic.
The The heading of the post is:
Passing values from excel to two jobs sequentially


and it got posted on June 28 Wednesday
Thanks,
Madhavi
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

DSguru2B wrote:That link is not working. Its taking me to a login page and once i login, it dosnt show the topic.
The The heading of the post is:
Passing values from excel to two jobs sequentially


and it got posted on June 28 Wednesday
Thanks,
Madhavi
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

-craig

"You can never have too many knives" -- Logan Nine Fingers
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

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.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
pmadhavi
Charter Member
Charter Member
Posts: 92
Joined: Fri Jan 27, 2006 2:54 pm

Post by pmadhavi »

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.
Thanks,
Madhavi
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

You mean not bugging us :wink:
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.
Post Reply