BillyBoyo wrote:I think you are confusing terminology.
When we "read" a variable-length record we use READ and the record appears for us and we can use the/an 01 under the FD for the file to access the record.
X'21' is 33, by the way.
Reference-modification has no problem using values in a binary field.
Can you exactly describe what it is you are trying to do?
Robert Sample wrote:Your length field is a 2-byte binary value, which can be defined in COBOL as. Hence you could do something like this (untested code):77 FIELD-LENGTH PIC S9(04) COMP (or COMP-5)and repeat for the length of INPUT-VAR.MOVE 1 TO OFFSET-VAR.
MOVE INPUT-VAR (OFFSET : 2) TO FIELD-LENGTH.
ADD 2 TO OFFSET.
MOVE INPUT-VAR (OFFSET : FIELD-LENGTH) TO <other variable>.
ADD FIELD-LENGTH TO OFFSET.