OPENing a member in append mode will overwrite the existing contents.
EXAMPLE PROGRAM
program
open mem dsn="EXAMPLES.APPEND" member write
write (mem) "hello"
close mem
end program
program
open mem dsn="EXAMPLES.APPEND" member append
write (mem) "world"
close mem
end program
WORKAROUND
Use FWRITE to copy the member to a file, append to the file and FREAD it back:
program
execute dbms "FWRITE 'TEMP.TXT' EXAMPLES.HELLO"
. OPEN MEM DSN="TEMP.TXT" APPEND IOSTAT=RC
. WRITE (MEM) "c this appended added"
. CLOSE MEM
execute dbms "DELETE MEMBER EXAMPLES.HELLO /NOINFORM /OK"
execute dbms "FREAD 'TEMP.TXT' EXAMPLES.HELLO"
end program