Actually i am trying to write and then update the file using seek,I am facing issue there.I am getting maxcc = 4 but nothing is written inside the dataset.In spool i am getting all the printf statements.Please look through my code and let me know the changes.
Thanks in advance!!
#include <stdio.h>
int main(void)
{
FILE *fp;
printf("Process file open\n");
fp = fopen("DD;FILE3","w+");
printf("File opened\n");
fputs(fp,"This is C program in Mainframe");
printf("Data inserted\n");
fseek( fp, 7, SEEK_SET );
printf("Seek performed\n");
fputs(fp,"C Programming Langauge");
printf("Data transformed\n");
fflush(fp);
fclose(fp);
printf("File Closed\n");
return(0);
}
int main(void)
{
FILE *fp;
printf("Process file open\n");
fp = fopen("DD;FILE3","w+");
printf("File opened\n");
fputs(fp,"This is C program in Mainframe");
printf("Data inserted\n");
fseek( fp, 7, SEEK_SET );
printf("Seek performed\n");
fputs(fp,"C Programming Langauge");
printf("Data transformed\n");
fflush(fp);
fclose(fp);
printf("File Closed\n");
return(0);
}