Read/Write large record length (binary file)

Example:
1 #grp
2 #a(a1000/100)
2 #p(p2)
2 #n(N10/10)
2 #L(L/10)
2 #b(b2/3)
2 #c (c/2)

Now I want to write it all using wwf
Write work file 1 #grp
And then read it
Reset #grp
Read Work file 1 #grp

The record length > 32766 (max size to binary file)
But according to document I can use wwf & rwf with other format in order to write/read large record
How can it be done?
I am runnig under Linux REHL 7.9 Nat 9.1.2

Write the work file in sections. In your example, it will be 4 sections.

DEFINE DATA LOCAL
1 #REC
  2 #A(A1000/100)
  2 #BLOCK
    3 #P(P2)
    3 #N(N10/10)
    3 #L(L/10)
    3 #B(B2/3)
    3 #C (C/2)
1 #I (I4)
END-DEFINE
FOR #I = 1 10
  ADD 1 TO #P
  ADD 10 TO #N (1)
  WRITE WORK 01 VARIABLE #A (01:030)
  WRITE WORK 01 VARIABLE #A (31:060)
  WRITE WORK 01 VARIABLE #A (61:090)
  WRITE WORK 01 VARIABLE #A (91:100)
                         #BLOCK
END-FOR
*
RESET #I
READ WORK 01 #A (01:030)
  ADD 1 TO #I
  READ WORK 01 ONCE #A (31:060)
  READ WORK 01 ONCE #A (61:090)
  READ WORK 01 ONCE #A (91:100)
                    #BLOCK
  DISPLAY #I
          #P
          #N (1)
END-WORK
END

HI
Well. I cant cause it is a common utility and not a dedicated for one structure only.
I thought to convert the group to (b) dynamic and then write it to the file,
but I couldnt find a way to read the file and to set it back to the group

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.