I got the source as varchar, trimmed and specified the routine and i specified the output format as "CHAR". This did not work.
Could there be any other problem?... plz help
Server routine in a parallel job with a Basic transformer?
Moderators: chulett, rschirm, roy
Ok. Lets take a step back. Build a simple routine and call it from within a basic transformer in a px job.
Build a text file with a few records that have AAA at different places. Run the px job. See if all instances of 'AAA' get replaced with 'xxx'
Code: Select all
Ans = EREPLACE(Arg1, "AAA", "xxx")
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Here'sthe post I was referring to. Feel free to tweak it to fit your needs.
For a final shot, recreate your original routine. Re-compile it and see if it works. There is nothing wrong with it, apparantly.
For a final shot, recreate your original routine. Re-compile it and see if it works. There is nothing wrong with it, apparantly.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
The following should work for you. Its your BASIC routine translated in C.
Code: Select all
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
char* myStripChar(char *str)
{ //Declare Variables
const int size = 1000;
char ch;
char* ret = (char *)malloc (size);
int ascii, i;
i = 0;
ascii = 0;
while (*str) //for the complete input string
{
ch = *str++;
ascii = ch;
if ((ascii >= 32) && (ascii <= 122) && (ascii != 91) && (ascii != 93) && (ascii != 94))
{
strcpy(&ret[i++], &ch);
}
}
ret[i] = '\0'; //Terminate the string
return ret;
}
Last edited by DSguru2B on Fri Mar 02, 2007 10:42 am, edited 1 time in total.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.