Hi

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
JSWARBRI
Participant
Posts: 14
Joined: Fri Jan 23, 2004 8:37 am

Hi

Post by JSWARBRI »

Sequencers and Triggers

Hi,

I have a job that is called from a sequencer and reads from a table.

If the read produces no rows, I want to stop the sequencer, if it produces rows I want it to run the next job.

Is there a way to do this with in the sequencer??

Thanks,
John
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Aye Up, John!

you can call your own routine activity with a user-written routine to return then number of rows processed through a link for you. The routine would have

Code: Select all

Handle = DSAttachJob(<JobThatWasCalled>,DS.LOGFATAL)
NumberOfRows = DSGetLinkInfo(Handle,<StageName>,<LinkName>,DSJ.LINKROWCOUNT)
Dummy = DSDetachJob(Handle)
JSWARBRI
Participant
Posts: 14
Joined: Fri Jan 23, 2004 8:37 am

Post by JSWARBRI »

Aye up Arnd,

Hope you're keeping well.

I written this:
Handle = DSAttachJob("JxDSSFCRSynTAMNAGRP01", DS.LOGFATAL)
Ans = DSGetLinkInfo(Handle, "OCI_T1_OFF_STRUCT_REF", "Ln_In_T1_NDS_OFF_STRUCT_REF", DSJ.LINKROWCOUNT)
Dummy = DSDetachJob(Handle)
But I get the following error when trying to compile the routine:
0003 Ans = DSGetLinkInfo (Handle, "OCI_T1_OFF_STRUCT_REF", "Ln_In_T1_NDS_OFF_STRUCT_REF", DSJ.LINKROWCOUNT)

',' unexpected, Was expecting: '!', ')', '=', "AND", "OR", "LT", "LE",
"GT", "GE", "NE", "EQ", "MATCH"
Array 'DSAttachJob' never dimensioned.
WARNING: Variable 'DS.LOGFATAL' never assigned a value.
Array 'DSGetLinkInfo' never dimensioned.
Array 'DSDetachJob' never dimensioned.

4 Errors detected, No Object Code Produced.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You need to have the following line in your job

Code: Select all

   $INCLUDE DSINCLUDE JOBCONTROL.H
to include the job mnemonics.

p.s. The jobname indicates you are still in the same place :shock:. Do you recall that we still have something open? How is the project going?
JSWARBRI
Participant
Posts: 14
Joined: Fri Jan 23, 2004 8:37 am

Post by JSWARBRI »

Smashing, works a treat, cheers mate.

I am in the same place and will be til end of Jan.

Being as diplomatic as I can, Project is OK, with a few issues still to iron out.

I remember our open "something" and it will be with the other in the next day or two.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Glad to hear that things are working out at the project and for this job; I'm sure it's a busy time for you!
Post Reply