I'm a novice trying to get a simple C program running under MVS.

I'm attempting to get file output to
//OUTF DD SYSOUT=A
with the following program.

#include <stdio.h>
int main(void)
{
  FILE *outf = NULL;
  printf("TESTFILE has been entered.\n");
  outf = fopen("dd:OUTF","recfm=fba, w+");
  if (!outf)
    {
    printf("fopen error on FILE *outf.\n");
    return 4;
    }
  fprintf(outf, "outf open ...\n");
  fclose(outf);
  return 0;
}

So far, with many variations to the fopen string, I get only the following output on SYSPRINT, no output to OUTF.

TESTFILE has been entered.
fopen error on FILE *outf.

Can anyone give me some advice on how to code this correctly ?

Regards

Lorne Dudley
Queen's University
Kingston, Ontario

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html

Reply via email to