fix file access issue
This commit is contained in:
parent
7fd140595a
commit
cf443e62b5
@ -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
|
||||
//
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user