Page 1 of 1

Help Required while using Custom Stage - parallel Job

Posted: Mon Feb 09, 2009 3:07 am
by NJ
Hi,

I am using custom stage in one of my parallel jobs.

job structure is like sequential/input stage ----> Custom Stage-----> seq/output stage.

In custom stage i have written one C++ progarm and have given path of the object file of that C++ program and also mapped the output of the cout of the C++ program to the column of the datastage Output/seq file.

while executing the job ... in designer jobs is getting executed and showing that 17 records are getting inserted in output file.... but in director i am getting error like "Test_Custom_65,0: Wrapped Unix command '/home/cbidev01/NJ/URL' terminated with error, signal 6.Test_Custom_65" ---'/home/cbidev01/NJ/URL' is the path of object file of C++ program. along with the above error message I am also getting this warining ---"Test_Custom_65,0: subprocess failed with Unix signal 6(SIGABRT)Test_Custom_65".

please help me to resolve this issue.



Thanks,
NJ

Posted: Mon Feb 09, 2009 4:05 pm
by ray.wurlod
Do you have a Custom stage or a Wrapped stage? It's the program itself (the "UNIX command") that failed, so you'll need to concentrate your diagnostic efforts on that.

Posted: Tue Feb 10, 2009 1:53 am
by NJ
Hi Ray...

yes I have custom stage... and below C++ progarm i have wriiten:

cat>test_URL.cpp

#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>

using namespace std;

int main ()
{

string URL;

ifstream infile("/home/cbidev01/NJ/URL.txt");

while (!infile.eof())
{
getline(infile, URL);

URL.erase(remove_if(URL.begin(), URL.end(), isspace), URL.end());

if (URL.substr(0,7) == "http://" )
{
URL = URL.substr(7,URL.length());
}

else if (URL.substr(0,8) == "https://")
{
URL = URL.substr(8,URL.length());
}


if ((URL.substr(0,4)) == "www.")
{
URL = URL.substr(4,URL.length());

}


int loc = URL.find("?",0);
URL = URL.substr(0, loc);



int last_dot = URL.find_last_of(".", URL.length());
int last_slash = URL.find_last_of("/",URL.length());

if (last_dot > last_slash and last_slash > 0)

{
URL = URL.substr(0,last_dot);

}
else

URL = URL;

if((URL.substr(URL.length() -1,URL.length())) == "/")
{
URL = URL.substr(0,URL.length()-1);
}


cout<<URL<<endl;

}
infile.close();

return(0);
}



lpar5m cbidev01 /home/cbidev01/NJ $>xlC_r test_URL.cpp -o URL
lpar5m cbidev01 /home/cbidev01/NJ $>

and have given /home/cbidev01/NJ/URL as operator path in Custom stage.

Let me know If I have to do anything more..while executing the Custom stage in DS job.


Thanks,
NJ

Posted: Tue Feb 10, 2009 6:03 pm
by Kryt0n
NJ wrote:Hi Ray...

yes I have custom stage... and below C++ progarm i have wriiten:

int main ()
{


NJ
from what little I have read of custom stages, my understanding is that you don't have a main function but a standard function name... in your case URL and that is what you call.

I've only just started reading up on them so please ignore if what you are doing is valid...