diff --git a/jcl/TXTWKR01.jcl b/jcl/TXTWKR01.jcl index c97a3cd..58c762a 100644 --- a/jcl/TXTWKR01.jcl +++ b/jcl/TXTWKR01.jcl @@ -1,8 +1,7 @@ //TXTWKR01 JOB (GCC),'File I/O Example', -// NOTIFY=@05054,CLASS=A,MSGCLASS=H, +// NOTIFY=@05054,CLASS=A,MSGCLASS=A, // MSGLEVEL=(1,1),REGION=4M,TIME=1440 //* Compile and Go Step //STEP1 EXEC GCCCG,INFILE='@05054.SRCLIB.C(TXTWKR01)' -//GO.TESTDD DD DSN=@05054.DATA(TESTMEM),DISP=OLD -// - +//GO.TESTDD DD DSN=@05054.DATA(TESTMEM),DISP=SHR +// \ No newline at end of file diff --git a/src/TXTWKR01.c b/src/TXTWKR01.c index 9dfa02a..5546b6a 100644 --- a/src/TXTWKR01.c +++ b/src/TXTWKR01.c @@ -14,10 +14,11 @@ int main() /* Open the file in update mode (read and write). */ /* The filename is "dd:DDNAME" where DDNAME is defined in JCL. */ - fp = fopen("dd:TESTDD", "r+"); + fp = fopen("dd:TESTDD", "a+"); if (fp == NULL) { - perror("fopen failed. Insure the member exists."); + perror("fopen failed."); + printf("errno = %d\n", errno); return 1; }