Error in Routines

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
Vinodanand
Premium Member
Premium Member
Posts: 112
Joined: Mon Jul 11, 2005 7:54 am

Error in Routines

Post by Vinodanand »

Hi,

I am getting the folowwing error in my routine 1 Errors detected, No Object Code Produced. Can any one help me on this....
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

can you send us the code. I believe there is a statment in your routine that the compiler is not able to construct. Need more info :!:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Vinodanand
Premium Member
Premium Member
Posts: 112
Joined: Mon Jul 11, 2005 7:54 am

Post by Vinodanand »

month = PD[6,7] - Counter
If month <= 0 then
day = PD[9,10]
yr = PD[1,4]
month = 12
yr -= 1
Date = yr:'-':month:'-':day
Else
day = PD[9,10]
yr = PD[1,4]
Date = yr:'-':month:'-':day
End;
Ans = Date

here PD & Counter are input arguments...
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

May I know how you use this basic routine in your PX jobs :shock:
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Try this

Code: Select all

month = ''
day = ''
yr = ''
Date = ''
ay = ''
month = PD[6,7] - Counter 
If month <= 0 then 
    day = PD[9,10]  
    yr = PD[1,4] 
    month = 12 
    yr = yr - 1 
    Date = yr:"-":month:"-":day 
End
If month > 0 then
day = PD[9,10] 
yr = PD[1,4] 
Date = yr:"-":month:"-":day 
End
Ans = Date 
:P
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Really, is it a PX forum. I thought he mention in the Job Type "Server" :shock:
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Vinodanand
Premium Member
Premium Member
Posts: 112
Joined: Mon Jul 11, 2005 7:54 am

Post by Vinodanand »

DSguru2B wrote:Really, is it a PX forum. I thought he mention in the Job Type "Server" :shock:
No its a server routine i'm talkin about
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

in your original code. you missed one one End. and there is no semicolon used after the last End.
heres your code. and the changes in bold

month = PD[6,7] - Counter
If month <= 0 then
day = PD[9,10]
yr = PD[1,4]
month = 12
yr -= 1
Date = yr:'-':month:'-':day
End
Else
day = PD[9,10]
yr = PD[1,4]
Date = yr:'-':month:'-':day
End
Ans = Date

Also, it would be nice if you could initilize the variables you are using. Otherwise you will see a warning in the director.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Vinodanand
Premium Member
Premium Member
Posts: 112
Joined: Mon Jul 11, 2005 7:54 am

Post by Vinodanand »

Hey guru,

Thnx mann.. It got compiled but what was the diff.. Do u mean that every variable should be initialized an initial value ...

Can we have an if else statement , if so hw can u give me an example..
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

Look at my previous post. The problem was not that you forgot to initilize the variables. The compiler wont give you the error that you were getting if you dont initize the variables.
Your problem was that you were missing one End.
for eg

Code: Select all

if (condition) then
statement 1
statement 2
statement 3
End
else
statement 7
statement 8
statement 9
End
The problem in your code was that you were missing the 'End' after statement 3 in my eg. above. Also you had a trailing semicolon ; after your last End.
Thats why the compiler was spitting back the code because it was not able to recognize the syntax.
Your only issue was syntax. And not the initilizing of the variables.

Code: Select all

BUT
, if you dont initilize your variables, you will see a warning in the director (log files) and not while compiling and testing the routine.
I hope that helps :)
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

And yea next time please post questions under right forum.
ADMIN: PLEASE MOVE THIS POST TO SERVER
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Vinodanand
Premium Member
Premium Member
Posts: 112
Joined: Mon Jul 11, 2005 7:54 am

Post by Vinodanand »

thnx once again and by the way i have posted in the right forum
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Vinodand,

you have posted to the PX forum and this is a server issue :?
If you use indentation or at least autoformat your jobs in the manager it would make the jobs easier to read, maintain and this error most likely would have been visible right away.
Vinodanand
Premium Member
Premium Member
Posts: 112
Joined: Mon Jul 11, 2005 7:54 am

Post by Vinodanand »

I'm sorry guys ... and thanks for the help.
Post Reply