Page 2 of 2

Posted: Sun Aug 13, 2006 8:55 pm
by dwblore
kduke wrote:You maybe looping back on yourself. So you are in an infinite loop.
hi

I was hoping that this statement would coz control to return to the calling function and therefore end the loop

If Index(x,"0 records",1) Then
Return(Ans)
End

I dont see why it wud continue in a loop :(

thnx

Posted: Mon Aug 14, 2006 6:32 am
by kduke
Recursive calls do work but I think this is a very poor idea. You are doing a SQL select without a ; at the end. Maybe that is the problem. What is the point of this? Do you just want to test recursive calls?

Edit your post and put code tags around your routine.

Posted: Mon Aug 14, 2006 6:00 pm
by dwblore
Hello Kim

The reason for my trying out this approach is to fetch all the sequences that calls a job directly or indirectly.

For instance if a job A has been called in SeqQ and SeqQ has been called in SeqMain1 then if JobA is passed as an argument to this routine it should return

SeqQ,SeqMain1

If it is being called in other sequences as well(ex SeqMain2), they too shud be listed

So our answer would be SeqQ,SeqMain1,SeqMain2

Code: Select all

Dependacy(aSearchString) 
DEFFUN Dependancy(aSearchstring) CALLING 'DSU.Dependancy' 

NAME = aSearchString 
Ans = '' 
i=0 

CMD = "SELECT DS_JOBS.NAME JobName from DS_JOBOBJECTS,DS_JOBS where DS_JOBOBJECTS.OLETYPE = 'CJSJobActivity' and EVAL DS_JOBOBJECTS.'@RECORD<12>' = '":NAME:"' and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO" 
EXECUTE CMD CAPTURING CMDRST ; 


x = convert (@FM , '|', CMDRST ) 

   If Index(x,"0 records",1) Then 
               Return("") 
   End 
   Else 
               Str = Trim(Field(x,'|',4,(count(x,'|')-5))) 
                 for i=1 to (count(Str,'|')+1) 
                     Ans=Field(Str,'|',i):Dependancy(Field(Str,'|',i)) 
                Next i 
   End 

Posted: Mon Aug 14, 2006 8:18 pm
by kduke
I think you could do this in one routine without a recursive call. That was my point. Build you a list of dependent jobs. Check the list before adding a job to make sure it is not already in the list.

Posted: Wed Sep 26, 2007 2:52 am
by ssunda6
Hi All,

I think using "dssearch" command is much easier if using version 7.x

dssearch -ljobs -uses -r <Project name> <job name>

"-r" recursively loops through the sub sequences also.

Regards,
ssunda.

Posted: Fri Oct 19, 2007 1:06 am
by saikrishna
Hi DS Gurus

When I try to do uvsh or dssh, I am getting the following error..

$ /home/dsadm/Ascential/DataStage/DSEngine/bin/uvsh "select jobname from dsjob"
/home/dsadm/Ascential/DataStage/DSEngine/bin/uvsh: error while loading shared libraries: libodbc.so: cannot open shared object file: No such file or directory


Thanks for your help.

Saikrishna

Posted: Fri Oct 19, 2007 8:42 am
by ray.wurlod
Execute the dsenv script first, and make sure your LD_LIBRARY_PATH variable is correctly set (to include this library's parent directory).

find out jobs from master seq

Posted: Sun May 04, 2008 6:18 am
by liron
Code:

select
DS_JOBS.NAME JobName FMT '40L',
DS_JOBOBJECTS.NAME LinkName FMT '30L',
EVAL DS_JOBOBJECTS."@RECORD<12>" AS JobActivtyJobName FMT '40L'
from
DS_JOBOBJECTS,
DS_JOBS
where
DS_JOBOBJECTS.OLETYPE = 'CJSJobActivity'
and DS_JOBS.NAME = 'Control_Sequence'
and DS_JOBOBJECTS.OBJIDNO = DS_JOBS.JOBNO
;
regarding that code where do i enter the SEQ name ? and how do i take this code and use it in a routine /// thanx sorry for the "novice" qes//

Posted: Sun May 04, 2008 5:56 pm
by jhmckeever
You're currently looking for a sequence named 'Control_Sequence' ...
and DS_JOBS.NAME = 'Control_Sequence'
In a routine you can execute the call with ...

Code: Select all

InputArg = {YourQuery}
Call DSExecute("TCL", InputArg, Output, SystemReturnCode)
J.