DsRoutines

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
tkbharani
Premium Member
Premium Member
Posts: 71
Joined: Wed Dec 27, 2006 8:12 am
Location: Sydney

DsRoutines

Post by tkbharani »

I am writing a routine as follows. It selects data from Hash File.
-----------------------------------------------------------
$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
LenJobName='30L'

Command = "SELECT CIRCLE FROM GEO "
Command := " WHERE CODE= ": Code :" ;"

Call DSExecute("UV",Command,Output,Code)
Ans=Output
@USER1 = Ans

MainExit:
Return(Ans)
-------------------------------------------------------------

The out I am getting as follows.
==================================
TEST #1
*******

Arg1 = 9324

Test completed.


Result = CIRCLE

MU

1 records listed.
==================================

I need to get only the value of the column,that is I need only MU .
I dont need column heading CIRCLE_CD and 1 records listed. The actual result is MU only.How to frame the query to avoid column headings.
Thanks, BK
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Using a routine is going to be WAY too slow. However, the answer to your actual question is that what is returned is the entire output of the command - you have to isolate the field (line) in which your result is displayed, for example Field(Output,@FM,3,1) or simply Output<3>.

The SQL could include a SUPPRESS COLUMN HEADING clause, but the output field number would be (at a guess) 2 not 3.

But far, far better would be simply to use the hashed file as a conventional lookup, supplying a reference input to a Transformer stage.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
tkbharani
Premium Member
Premium Member
Posts: 71
Joined: Wed Dec 27, 2006 8:12 am
Location: Sydney

Hint Please....

Post by tkbharani »

Can you please tel me how to delimit a the following output

I am using Field function as follows
Subst = Field(Output, " ", 1)

But I am not getting value,how to delimit the following
UASL_CIRCLE_CD

MU

1
Hint please :wink:
Thanks, BK
tkbharani
Premium Member
Premium Member
Posts: 71
Joined: Wed Dec 27, 2006 8:12 am
Location: Sydney

Re: Hint Please....

Post by tkbharani »

I got the desired output. using the command as follows.

Subst = Field(Output, @FM, 3)

where 3 is the third formated result.
thanks for reply Mr.Ray
Thanks, BK
Post Reply