Hello.
I'm trying to write variable length records to a SEQUENTIAL file. I don't want the trailing spaces to be removed. I add on two chars at the end of each record type and populate them with CRLF. My results are not what I expected. The output file appears to have binary characters and the rows are not the length of the value in WS-RECORD-LENGTH. My FD statement is:
FD MY-FILE
RECORDING MODE IS V
RECORD IS VARYING IN SIZE FROM 191 TO 370 CHARACTERS DEPENDING ON WS-RECORD-SIZE.
01 MY-RECORD.
05 MY-DATA PIC X(370)
In Working Storage
01 WS-TYPE1. (record length191)
05
05 WS-CRLF1 PIC X(2).
01 WS-TYPE2. (record length 370)
05
05 WS-CRLF2 PIC X(2).
Here's the code to populate the record.
MOVE SPACES TO WS-TYPE1.
MOVE blah blah
MOVE WS-RECORD-DELIMITER TO WS-CRLF1. (has hex values of CRLF)
MOVE 191 TO WS-RECORD-SIZE. (PIC 9(004) COMP)
MOVE WS-TYPE1 TO MY-RECORD.
WRITE MY-RECORD.
Any suggestions will be greatly appreciated





