SiouxCityElvis
Programmer
If I have a file that is 1 line and it has been told to me that it is a Binary Sequential File, how should I take that file and read it's one line into records with a length of 94?
I'm thinking...
FD BINARY-FILE-IN.
01 BINARY-RECORD PIC X(Huge/variable length unknown)
FD SEQ-LINE-OUT.
01 SEQ-RECORD PIC X(94).
WS-BINARY-IN PIC X(I have no idea what the length will be of its 1 huge line)
WS-LINE-SEQ-OUT PIC X(94)
OPEN BINARY-FILE-IN.
OPEN SEQ-LINE-OUT.
MOVE 1 TO BINARY-CTR.
PEFORM UNTIL SW-EOF-BINARY = "Y"
READ BINARY-RECORD
AT END
MOVE "Y" TO SW-EOF-BINARY
NOT AT END
MOVE BINARY-RECORD(BINARY-CTR:94)
TO WS-LINE-SEQ-OUT
WRITE SEQ-RECORD FROM WS-LINE-SEQ-OUT
MOVE SPACES TO SEQ-RECORD, WS-LINE-SEQ-OUT
ADD 94 TO BINARY-CTR
END-READ
END-PERFORM
I'm thinking...
FD BINARY-FILE-IN.
01 BINARY-RECORD PIC X(Huge/variable length unknown)
FD SEQ-LINE-OUT.
01 SEQ-RECORD PIC X(94).
WS-BINARY-IN PIC X(I have no idea what the length will be of its 1 huge line)
WS-LINE-SEQ-OUT PIC X(94)
OPEN BINARY-FILE-IN.
OPEN SEQ-LINE-OUT.
MOVE 1 TO BINARY-CTR.
PEFORM UNTIL SW-EOF-BINARY = "Y"
READ BINARY-RECORD
AT END
MOVE "Y" TO SW-EOF-BINARY
NOT AT END
MOVE BINARY-RECORD(BINARY-CTR:94)
TO WS-LINE-SEQ-OUT
WRITE SEQ-RECORD FROM WS-LINE-SEQ-OUT
MOVE SPACES TO SEQ-RECORD, WS-LINE-SEQ-OUT
ADD 94 TO BINARY-CTR
END-READ
END-PERFORM