Page 1 of 1

Access a Paralell routine

Posted: Fri Jan 18, 2008 3:20 am
by jusami25
Hi,

I have built a paralell routine with the following c code:

Code: Select all

#include "stdio.h"
#include "stdlib.h"

}
char * NextRunKey(char * inString)
{	
	char buffer[20];
	FILE *Test;
	char * key = buffer;
	int aux;

	if((Test = fopen(inString,"r")) == NULL){
		return "File not Exists";
	}
	else{
		fgets(key,10,Test);
		aux = atoi(key);
		aux = aux + 1;
		sprintf(key,"%i",aux);
		if(aux == 65536){
			key = "1     ";
		}
		rewind(Test);
		fprintf(Test,"%s",key);
		fclose(Test);
		return key;
	}
}
basically, the operation of the routine is read the number that is in a local file and return it, then sum one to the number and write it on the file.

if I run the code directly in unix console, works fine, but in DataStage only read the file, doesnt write on the file the following number.

I have checked all the permission in the folder and it is fine.

Can you help me ,please?

Posted: Fri Jan 18, 2008 5:20 am
by ray.wurlod
Well done for diagnosing before we could reply. Please mark the thread as Resolved.