Error in the routine

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

Post Reply
parvathi
Participant
Posts: 103
Joined: Wed Jul 05, 2006 4:48 am
Contact:

Error in the routine

Post by parvathi »

Hi all,

I have written a routine that gets the position of a certain character in astring and use the position to get value from another string..

the code is used is

Code: Select all


Equate c_routineName           To "rtnSplitRowsToColumns"
Ans=''
Lvl_indx=0
find_flag=''

if Lvl_name<>'' and Lvl_order<>'' and Lvl<>'' then 
 if Num(Lvl) then
    
    varCount= Count(Lvl_order,'%')+1
    for i=1 to varCount
      if Lvl= FIELD(Lvl_order,'%',i) then   
        Lvl_indx=i
        find_flag='Y'
      end
     next i

     if find_flag='' then Ans=''
     if find_flag='Y' then
     Ans = FIELD(Lvl_name,'%',Lvl_indx)

 end else
 Call DSLogFatal('Number expected for Lvl' , c_routineName )
 end

end else
Call DSLogFatal('Arguments Cannot be Null' , c_routineName )
end
when i compile i get the following error
Compiling: Source = 'DSU_BP/DSU.testing', Object = 'DSU_BP.O/DSU.testing'
***
0033
^
End of File unexpected, Was expecting: Array Name, Variable name,
New variable name, ';', Statement label, "ABORT", "ABORTE", "ABORTM",
"BEGIN", "BREAK", "CALL", "CHAIN", "CLEAR", "CLEARCOM", "CLEARDATA",
what could be the reason How do i resolve this?
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

Is it part of the code?
What is the line number 33?
Have you included "INCLUDE DSINCLUDE JOBCONTROL.H" at first?
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Click the Format tool in your routine editing window.
Check that the final End statement lines up with the RETURN(Ans).
If not, there's an imbalance.
Post the formatted code.

You have reinvented an intrinsic statement called Locate().
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As noted - why write this when a built-in function already exists to do this?
-craig

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