Writing a FormFeed to a sequential file using # generates LF+FF+LF $C(10,12,10)
Try this code:
GTM>U file W "abc",#
GTM>ZSYS "ls -l myFile.dat"
-rw-rw-rw- 1 sid dba 6 Mar 13 12:43 myFile.dat
As you can see, the length is 6 instead of 4 as expected. When I take a look at the content, I get "abc" + $C(10,12,10). GT.M wraps the FormFeed character $C(12) with 2 LineFeeds $C(10).
I noticed that if I change the Write statement to W "abc",*12 it' OK and adds only the $C(12) as expected.
If I change the Open parameters to NEW:WRAP:FIXED:RECORDSIZE=1:BLOCKSIZE=1
and let the Write statement as before: W "abc",# it works fine as well, but using these paremeters in large file could slower performance.
Is there a better way to avoid the $C(10) characters without changing the original code W "abc",# ?