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;
}
}
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?