delete universe records from DS 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
xli
Charter Member
Charter Member
Posts: 74
Joined: Fri May 09, 2003 12:31 am

delete universe records from DS function

Post by xli »

Hi,

I have a universe table containing log information, I want to delete records from it in terms of Batch job name, I tried the following code

*************************************************
JobHandle = DSJ.ME
JobName = DSGetJobInfo(JobHandle,DSJ.JOBNAME)

Cmd = "DELETE FROM BJOB_STATUS WHERE Batch_JobName = '" : JobName : "'"
Call DSLogInfo("The sql is " : Cmd, RoutineName)
Execute Cmd Capturing Msg
Call DSLogInfo(Msg, RoutineName)
**************************************************
I found it doesn't work.

Thanks in advance for your advice

xiong[8)]
Optico
Participant
Posts: 23
Joined: Thu Sep 18, 2003 9:32 am

Post by Optico »

Hi Xiong,

You haven't exactly included a lot of detail as to what is not working, but I do have a couple of suggestions for you :

Have you remembered the include : $INCLUDE DSINCLUDE JOBCONTROL.H
in your code ?

DSJ.ME is the jobhandle for the current job so you don't do the line:
JobHandle = DSJ.ME
Instead the next line should look like this:
JobName = DSGetJobInfo(DSJ.ME, DSJ.JOBNAME)

HTH



B. Sorensen,
Optico IT ApS
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

xiong

Delete from works fine. I think you forgot the ';'.

Kim.

Kim Duke
DsWebMon - Monitor DataStage over the web
www.Duke-Consulting.com
xli
Charter Member
Charter Member
Posts: 74
Joined: Fri May 09, 2003 12:31 am

Post by xli »

kim, you are right, I forgot";" in my code.

Thanks for your all advices.

xiong
Post Reply