Page 1 of 1

Invalid Event Type when using DSGetLinkInfo/DSLogInfo

Posted: Fri Jul 20, 2007 10:44 am
by Richard615
Hi;

In a server job I'm trying to simply grab a link row count, and write that to the log file. I have an AfterJob routine, which contains the following:

$INCLUDE DSINCLUDE JOBCONTROL.H
$INCLUDE DSINCLUDE DSJ_XFUNCS.H
ErrorCode = 0

OUTPUT = DSGetLinkInfo(DSJ.ME,"tran1","outlink",DSLinkRowCount)
Call DSLogInfo(OUTPUT, JobName)

When I run this, I wind up with an error code of -5 in my log, which according to the dsapi.h file is an "Invalid EventType value".

A search of the forum shows many posts that reference the EventType, but none that I saw which actually explain what the EventType is actually doing (and the DS help file didn't seem to help either).

Can someone please explain why I'm getting this error, and what in my snippet of code (which I cobbled together from some other posts regarding DSGetLinkInfo) might be causing the the problem? My forehead is starting to get sore from banging it against the keyboard.

Thanks,

-> Richard

Posted: Fri Jul 20, 2007 10:46 am
by chulett
The InfoType is quite clearly noted in the online help, check the entry for DSGetLinkInfo.

(edited to correct EventType to InfoType)

Posted: Fri Jul 20, 2007 11:02 am
by Richard615
Ah, yes, I see I had a typo in my InfoType field. Thanks - it now works as expected.

OUTPUT = DSGetLinkInfo(DSJ.ME,"tran1","outlink",DSJ.LINKROWCOUNT)

This is probably a boneheaded question, but are EventType and InfoType really that synonymous? I completely agree I should have made the connection in this small example, but if there was a larger chunk of existing code where I received an EventType error, I guess I wouldn't immediately think to start looking for InfoType fields. Though perhaps I should - I admit I'm fairly new to using the DS calls, and the related data types.

Thanks again.

Posted: Fri Jul 20, 2007 11:41 am
by chulett
No, they're not synonymous. EventType would have come from one of the 'Log' related functions. In the online help, use the Search tab and you'll see all of the functions that could have come from.