How to call DSfunction in C routine in paralle

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
monaz
Participant
Posts: 98
Joined: Sat Aug 23, 2008 3:14 am

How to call DSfunction in C routine in paralle

Post by monaz »

Hi,

Could anyone guide me how can i implement Utilityabortlog() fuctionality of server to parallel routine C code.

What all the declaration is required.

Please help me out on this if anyone has done on this.

Thanks
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

A simple fprintf will do the task.

You can use an exit to abort.
monaz
Participant
Posts: 98
Joined: Sat Aug 23, 2008 3:14 am

Post by monaz »

Sainath.Srinivasan wrote:A simple fprintf will do the task.

You can use an exit to abort. ...
Thanks Sainath...

I have attached my code below, actually my requiremnt is that i need to abort the job if certain condition does not match

$DSHOME/include/dsapi.h
#include DSINCLUDE JOBCONTROL.H
#include DSINCLUDE DSD_CONST.H
#include DSINCLUDE DSD.H

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

char get_msg_code ( char *,char *,char *);

char get_msg_code ( char *trailercount,char *detailrecordcount,char *recordlength)
{
char Errormessage="Input file is valid";
if (((detailrecordcount-2 )==( trailercount)) and recordlength=800)
{
Else if ((detailrecordcount-2 )!=( trailercount))
{
Call DSLogFatal("File header and trailer does not match", "Jobname") ;
exit (1);
}
Else if (((detailrecordcount-2 )!=( trailercount)) and (recordlength>800 or recordlength<800))
{
Call DSLogFatal("Informat source file", "Jobname") ;
exit (1);
}

}
return Errormessage;
} /* End */
monaz
Participant
Posts: 98
Joined: Sat Aug 23, 2008 3:14 am

Post by monaz »

Sainath.Srinivasan wrote:A simple fprintf will do the task.

You can use an exit to abort. ...

But I want log a message in the directory, what is the reason of abort can you please help me out how can i do this.
Post Reply