Need Routine Function

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
praburaj
Premium Member
Premium Member
Posts: 133
Joined: Thu Jun 30, 2005 1:26 am
Location: philippines

Need Routine Function

Post by praburaj »

Hai,

I am new in DataStage.


I have one doubt.

Example Coding:


Begin Case

Case Count (Arg1,'a') > 0

Ans = 19

Case Count ( Arg1, 'a') = 0

Ans = 20


We are checking for the PIPE ( " | " ) in the source, if we find

any PIPE inside the data like ( Sur|esh | 2345 | taj), the whole job going

to be rejected. Here I am using OCI STAGE, TRANSFORM1, OUTPUT

TRANSFORM, SEQUENFILE

I need create a routine. That routine i need to apply OCI_Source. Here

two options Before and After. In Before Options we need to apply some

routine functions. And then We need to create one dummy value in

Output_ Transformer. In that value we apply our Routine functions.

Plz give me the suggestions. How can i do that. Plz its very urgent.

I need the query. Plz send me briefly.


Regards,

prabu
g_rkrish
Participant
Posts: 264
Joined: Wed Feb 08, 2006 12:06 am

Re: Need Routine Function

Post by g_rkrish »

praburaj wrote:Hai,

I am new in DataStage.


I have one doubt.

Example Coding:


Begin Case

Case Count (Arg1,'a') > 0

Ans = 19

Case Count ( Arg1, 'a') = 0

Ans = 20


We are checking for the PIPE ( " | " ) in the source, if we find

any PIPE inside the data like ( Sur|esh | 2345 | taj), the whole job going

to be rejected. Here I am using OCI STAGE, TRANSFORM1, OUTPUT

TRANSFORM, SEQUENFILE

I need create a routine. That routine i need to apply OCI_Source. Here

two options Before and After. In Before Options we need to apply some

routine functions. And then We need to create one dummy value in

Output_ Transformer. In that value we apply our Routine functions.

Plz give me the suggestions. How can i do that. Plz its very urgent.

I need the query. Plz send me briefly.


Regards,

prabu


Can you Explain whats is your I/P and what is your Expected o/p.then we can figure out do you really need a routine or not.

Thanks,
RK
RK
I_Server_Whale
Premium Member
Premium Member
Posts: 1255
Joined: Wed Feb 02, 2005 11:54 am
Location: United States of America

Post by I_Server_Whale »

Hi Prabu,

FYI. Urgent requests are looked down upon in this forum. I too made the mistake once long time ago, but I learnt my lesson. This is a wonderful forum where your requests are most likely to be answered if it is not tagged as 'URGENT'.

Well ! Upon reading your question. I really did not get what you were trying to achieve. Could you please re-phrase it so that it could be well understood. I mean, what is the requirement and what should be the routine's functionality be?

Many Thanks,
Whale.
Last edited by I_Server_Whale on Thu Nov 16, 2006 6:21 pm, edited 1 time in total.
Anything that won't sell, I don't want to invent. Its sale is proof of utility, and utility is success.
Author: Thomas A. Edison 1847-1931, American Inventor, Entrepreneur, Founder of GE
kcbland
Participant
Posts: 5208
Joined: Wed Jan 15, 2003 8:56 am
Location: Lutz, FL
Contact:

Post by kcbland »

You should probably send all errant rows into an exceptions file and then use job control to check the exceptions file.

The simplest solution is to use a CONSTRAINT in the transformer stage and two output links. The first output links are the good rows, and the second output link has the REJECT box checked in the constraint for that link. On the first output link, make sure it's in link order position #1, and use this as the constraint:

Code: Select all

COUNT(link.column#1, "|") = 0 AND COUNT(link.column#2,"|") = 0 AND etc.
subsituting link.column# for your input link name and each column you wish checked.

Set the Abort after N rows setting on the reject link to 1, which will cause the job to abort when the first row goes down that link.

No more URGENT help please. If you want URGENT help, you should pay for it. At least become a Charter/Premium Member, as I focus on helping those folks first because they're paying for the bandwidth and webmaster costs.
Kenneth Bland

Rank: Sempai
Belt: First degree black
Fight name: Captain Hook
Signature knockout: right upper cut followed by left hook
Signature submission: Crucifix combined with leg triangle
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

From an efficiency point of view, an Index() function looking for the first occurrence may be preferable.

Code: Select all

Index(link.column#1, "|", 1) = 0 And Index(link.column#2,"|", 1) = 0 And ...
Then you could make use of the Boolean context to strip out the comparisons with 0 which is even (marginally) more efficient.

Code: Select all

Not(Index(link.column#1, "|", 1) Or Index(link.column#2,"|", 1) Or ...)
Small efficiency gains multiply as the number of rows processed.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
praburaj
Premium Member
Premium Member
Posts: 133
Joined: Thu Jun 30, 2005 1:26 am
Location: philippines

Re: Need Routine Function

Post by praburaj »

Hey rk,


Hai guys,

I have one doubt.

Example Coding:
Input : Aravind

Begin Case

Case Count (Arg1,'a') > 0

Ans = 19

Case Count ( Arg1, 'a') = 0

Ans = 20

My Source Column is:

Acct Code, Dept Code, Dept_desc, Alloc_method.

Example Code:

AcctCode, DeptCode, Dept_desc,Alloc_method

123 | ACCS | Account St|atus | sdedd

245 | AS|ID | Sta|tusMethod |skmje


Before going to extract data , We are checking for the PIPE ( "

| " ) in the source, if we find any PIPE inside the data like ( Sur|esh |

sundar | karthik), the job going to be rejected.

Here we are using OCI STAGE, TRANSFORM1, OUTPUT TRANSFORM,

SEQUENFILE. I need create a routine. That we applied inside the

OCI_Source. Here two Procedure Before and After. In Before Options I

need to apply the routine functions. And then I need to create one

dummy value in Output_ Transformer. In that

value we apply our Routine functions.

Plz give me the suggestions. How can i do that.

I need the query. Plz send me briefly.


Regards,

Suresh A R
praburaj
Premium Member
Premium Member
Posts: 133
Joined: Thu Jun 30, 2005 1:26 am
Location: philippines

Post by praburaj »

ray.wurlod wrote:From an efficiency point of view, an Index() function looking for the first occurrence may be preferable.

Code: Select all

Index(link.column#1, "|", 1) = 0 And Index(link.column#2,"|& ...[/quote]

Hey ray.

     Thanks for ur reply.  

my source column is

AcctCode, Acctdesc,allocmethod, AcctDescr.

For this Index function where i can use.  Either in OCI Stage or Inside the 

Transformer.  

plz send the query briefly. Sorry for my poor knowledge.


Thanks.

prabu
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The only place you can use expressions in server jobs is within the Transformer stage. No other stage type supports data modification expressions.

Within the Transformer stage is an Expression Editor that allows you to select operands and operators from menus, so that very little (error-producing) typing is required.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
praburaj
Premium Member
Premium Member
Posts: 133
Joined: Thu Jun 30, 2005 1:26 am
Location: philippines

Post by praburaj »

Hey Ray,

Really Thanks. My job is working properly. I really thanks to

everyone. Thanks, for ur timely help. In this forum really helps for all

beginners like me. Thanks guys. :D

Thanks

prabu
Post Reply