Access a Paralell routine

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
jusami25
Premium Member
Premium Member
Posts: 84
Joined: Tue Oct 26, 2004 12:49 am

Access a Paralell routine

Post 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?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Well done for diagnosing before we could reply. Please mark the thread as Resolved.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply