如何用C写DataStage Parallel Job 的Routine

 我来答
波谷很忙
推荐于2016-07-09 · TA获得超过1.3万个赞
知道大有可为答主
回答量:2540
采纳率:88%
帮助的人:1515万
展开全部
1、用C开发Parallel Routine,需要用到 Makefile去编译C文件

创建C文件和Makefile文件,

C文件如下:

/*

//

// Example functions to be used as parallel external user functions in the transformer stage

//

// These are examples for Solaris, and are intended for demonstration purposes only.

//

*/

#include "string.h"

/*

// Case 1: Returning an int value

*/

int TrxFuncInt()

{

return -1034;

}

/*

// Case 2: Returning an unsigned char

*/

unsigned char TrxFuncUChar()

{

return (unsigned char)'&';

}

/*

// Case 3: Returning a long

*/

long long TrxFuncLong()

{

return 119921;

}

/*

// Case 4: Returning a char string

*/

char* TrxFuncCharStr()

{

return (char*)"TestString";

}

/*

// Case 5: A function taking one of each type of argument

*/

int TrxFuncAllArgs(signed char arg1, unsigned char arg2,

short arg3, unsigned short arg4,

int arg5, unsigned int arg6,

long long arg7, unsigned long long arg8,

float arg9,

double arg10,

char* arg11)

{

int retval;

/*

// this just checks the value of each input argument. If all the values are

// as expected then it returns 0, otherwise -1

*/

if (arg1 != '&') {

retval = -1;

} else if (arg2 != (unsigned char)'&') {

retval = -1;

} else if (arg3 != -3) {

retval = -1;

} else if (arg4 != 4) {

retval = -1;

} else if (arg5 != 5555) {

retval = -1;

} else if (arg6 != 6665) {

retval = -1;

} else if (arg7 != -77777) {

retval = -1;

} else if (arg8 != 87654) {

retval = -1;

} else if ((arg9 <= 2.2) || (arg9 >= 2.4)) {

retval = -1;

} else if (arg10 != 4.3) {

retval = -1;

} else if (strcmp(arg11, (char*)"TestString") != 0) {

retval = -1;

} else {

retval = 0;

}

return retval;

}
本回答被提问者和网友采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式