Error in include JOBCONTROL.H

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
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Error in include JOBCONTROL.H

Post by gpbarsky »

Hi there.

I took the following code from one topic within this forum.

$INCLUDE DSINCLUDE JOBCONTROL.H
JobName = "MasterJob.p1111111111";
RunHandle = DSAttachJob(JobName, DSJ.ERRNONE)
JStat = DSGetJobInfo(RunHandle, DSJ.JOBSTATUS)
ContinueFlag = @true
begin case
case JStat = 0
JobStatus = "Running"
JStat = DSStopJob(RunHandle)
case JStat = 1
JobStatus = "Finished"
case JStat = 2 ; * Finished with warnings
JobStatus = "Finished (see log)"
case JStat = 3
ContinueFlag = @false
JobStatus = "Aborted"
case JStat = 11
JobStatus = "Validated OK"
case JStat = 12 ; * Validated with warnings
JobStatus = "Validated (see log)"
case JStat = 13
JobStatus = "Failed validation"
case JStat = 21
JobStatus = "Has been reset"
case JStat = 96
ContinueFlag = @false
JobStatus = "Aborted"
case JStat = 97
JobStatus = "Stopped"
case JStat = 98
JobStatus = "Finished"
case JStat = 99
JobStatus = "Compiled"
case @true
ContinueFlag = @false
JobStatus = "Not Compiled"
end case
call dsloginfo("Status of ":JobName:" is ":JobStatus,"MSG");

When I compile this job, I get the following error:

---------------------------------------------------------------------
INCLUDEd file is 'dsinclude/JOBCONTROL.H'
0008.01 * This is unpublished proprietary source code of Vmark Software Inc. ^
Unexpected end of input, $ENDIF missing

?****

1 Errors detected, No Object Code Produced.
(ValidaJob)
---------------------------------------------------------------------

Can anybody tell me what's wrong ? Do I need to install the SDK ?

Thanks in advance.


Guillermo P. Barsky
Buenos Aires - Argentina
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

As far as I know, you always need to wrap your $INCLUDE like this:

$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF

-craig
mhester
Participant
Posts: 622
Joined: Tue Mar 04, 2003 5:26 am
Location: Phoenix, AZ
Contact:

Post by mhester »

Guillermo,

The only thing I can see is the call to DSLogInfo. If the call is truly like you have in the post then the name is wrong (should be proper case like DSLogInfo).

I ran this very segment of code as a server routine, BASIC program from UV etc... and it worked correctly.

Try changing the dsloginfo to DSLogInfo (it does matter)

Regards,

Michael Hester

Also, it is not necessary to surround the $INCLUDE by -

$IFNDEF JOBCONTROL.H
$INCLUDE DSINCLUDE JOBCONTROL.H
$ENDIF
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post by gpbarsky »

Thank you, Michael and Craig.

I changed the DSLogInfo call and it worked fine.

The question is: why the compiler did not send me an error message, if the sentence I put is: "call dsloginfo(....." and this is not recognized as a valid call ?


Guillermo P. Barsky
Buenos Aires - Argentina
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Guillermo

The compiler for a routine is wrapped around the Universe BASIC compiler and the error messages are not as informative as the original. That is why Michael jumped out and used the BASIC compiler. Old Universe programmers know these tricks and can debug faster because of it. It helps to know what DataStage is doing underneath the covers and Michael is an ex-Ascential consultant and is very knowledgable of Universe.

Kim.

Kim Duke
DsWebMon - Monitor over the web
www.Duke-Consulting.com
gpbarsky
Participant
Posts: 160
Joined: Tue May 06, 2003 8:20 pm
Location: Argentina

Post by gpbarsky »

Thank you, Kim.

Now that I can get the status of a job (from within a BASIC job), what is the name of the API that I have to invoke in order to delete it from the system ? Does it exist ?


Guillermo P. Barsky
Buenos Aires - Argentina
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Guillermo

You can do this as a BASIC program and execute it as a TCL command. You can do it as a job and send the job name as a parameter. You can do it as a routine. Take your pick. You could also write it a Visual Basic routine which is a little more complicated. I would write it as a TCL command. I explained how to compile and catalog in another topic today. Let me know how it goes.

Kim.

Kim Duke
DsWebMon - Monitor over the web
www.Duke-Consulting.com
Post Reply