add a read after the write
Some checks failed
MVS Delete Members / delete-members (push) Failing after 13s
MVS Submit & Execute / upload-and-run (push) Successful in 53s

This commit is contained in:
Greg Gauthier 2026-02-08 18:20:17 +00:00
parent ef09918b95
commit 4237e6a041
2 changed files with 18 additions and 2 deletions

View File

@ -1,4 +1,4 @@
//TXTWKR01 JOB (GCC),'File I/O Test',NOTIFY=@05054,CLASS=A,MSGCLASS=H,
//TXTWKR01 JOB (GCC),'File I/O Test',NOTIFY=@05054,CLASS=A,MSGCLASS=A,
// MSGLEVEL=(1,1),REGION=4M,TIME=1440
//STEP1 EXEC GCCCG,INFILE='@05054.SRCLIB.C(TXTWKR01)'
//GO.TESTDD DD DSN=@05054.DATA(TESTMEM),DISP=SHR,

View File

@ -12,7 +12,7 @@ int main(void)
int count = 0;
char buf[LINE_LEN];
/* === Read phase === */
/* === Read phase before write === */
fp = fopen("dd:TESTDD", "r");
if (fp == NULL) {
fputs("Cannot open for read\n", stdout);
@ -42,6 +42,22 @@ int main(void)
fclose(fp);
/* === Read phase after write === */
fp = fopen("dd:TESTDD", "r");
if (fp == NULL) {
fputs("Cannot open for read\n", stdout);
return 1;
}
fputs("Existing content:\n", stdout);
while (fgets(buf, LINE_LEN, fp) && count < MAX_LINES) {
fputs(buf, stdout); /* echo to JES */
strncpy(lines[count], buf, LINE_LEN-1);
lines[count][LINE_LEN-1] = '\0';
count++;
}
fclose(fp);
fputs("Append complete (via rewrite).\n", stdout);
return 0;
}