Problem in running a routine

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Problem in running a routine

Post by priyadarshikunal »

When I am trying to run this routine
it never ends i am unable to find why?
Can any one help me to find out what is the problem?

Code: Select all

i=1
loop until i>10 DO
  if i>10 then exit 
  StageName=FIELD(Stages,",",i)
  if StageName eq "" then exit
  Links= DSGetStageInfo(JobHandle, StageName, DSJ.LINKLIST)

     j=1
     Loop until j>10 DO
      if j>10 then exit

      LinkName=FIELD(Links,",",j)
      if LinkName eq "" then exit

      RowCount= DSGetLinkInfo (JobHandle, StageName, LinkName,DSJ.LINKROWCOUNT)

      ReportText =  JobName:",":JobStarted:",":JobEnded:",":JobStatus:",":StageName:",":LinkName:",":RowCount:"\n"
      GlobalReport = GlobalReport:Char(10):ReportText
        
  Repeat
Repeat 

     

Thanks in advance
Last edited by priyadarshikunal on Sun Jul 01, 2007 11:34 pm, edited 1 time in total.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

First, explain what you understand the routine to be doing, what arguments it requires and how/where exactly you are 'running' it.
-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 »

You are running two loops (i and j). You initialize them but never increment them. The condition (i>10) and (j>10) is never true and hence an infinite loop.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

DSguru2B wrote:You are running two loops (i and j). You initialize them but never increment them. The condition (i>10) and (j>10) is never true and hence an infinite loop.
Thanks DSguru2B Its working fine now;
can you tell me how to append that file while running next job?
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

DSguru2B wrote:You are running two loops (i and j). <snip>
Fine and dandy. Still don't think it is appropriate to just post a chunk of code and say "It doesn't work, please fix it for me" without something in the way of documentation or an explanation. Even if the answer is obvious, the OP needs to have some skin in the game. IMHO, of course.
-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 »

Refer to the BASIC manuals on how to open a file in BASIC which will bring the pointer to the end of file. Hence when you write again, it will get appended. You should really re-think your approach as , if you call this routine after each job and say you have 50 jobs, this one file can get really huge.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

chulett wrote:
DSguru2B wrote:You are running two loops (i and j). <snip>
Fine and dandy. Still don't think it is appropriate to just post a chunk of code and say "It doesn't work, please fix it for me" without something in the way of documentation or an explanation. Even if the answer is obvious, the OP needs to have some skin in the game. IMHO, of course.
I am sorry for not sending the proper documentation;

Actually the two arguments were
Arg1="directory path;filename"
Arg2="JobName"

that was a silly mistake but i was looking on it for its other aspects
that made me more confused

sorry once again chulett
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

and one more thing i am calling it in job sequence after a job to get statistics of that job
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

If you mean append to an existing file in your routine, SEEK is what you seek. It's not a "how to open the file" kind of thing, but something you do just after opening it before you start writing.
-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 »

Craig is right, as always :wink: .
Read about SEEK in the BASIC guide for a better understanding of what it does and how to use it.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

DSguru2B wrote:Refer to the BASIC manuals on how to open a file in BASIC which will bring the pointer to the end of file. Hence when you write again, it will get appended. You should really re-think your approach as , if you call this routine after each job and say you have 50 jobs, this one file can get really huge.

actually i wanted it to have details of the jobs to achive a single task

like we have 2 to 3 jobs for one task i wanted it to extend it so that to make some condition check easy

i am also thinking to expand it for a sequence so that to get statistics of jobs (2-3 jobs inside a sub-sequence)


thanks and regards
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Post Reply