Subject: | |
From: | |
Reply To: | |
Date: | Fri, 27 Sep 2002 13:46:06 -0700 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
> -----Original Message-----
> From: [log in to unmask]
>
> I assume that this is a simple problem that someone here has already
> solved... [convert var-length bytestream file to fixed length]
Wouldn't the HP supplied FROMBYTE/TOBYTE programs do this? At the very
least, "frombyte" would convert this to a VARIABLE length file, which in
turn can be FCOPY'd to a fixed length file as needed...
> and still terminated with CRLFs.
that doesn't make sense -- if the record is "fixed length", why would there
be any need for a CR/LF?
Actually, my first thought was a "simple COBOL program" along these lines:
DATA DIVISION.
01 FIXED-BUFFER.
05 VAR-BUFFER PIC X(whatever).
05 filler pic x value %15.
05 filler pic x value %12.
PROCEDURE DIVISION.
MOVE SPACES TO VAR-BUFFER
ACCEPT VAR-BUFFER FREE
DISPLAY FIXED-BUFFER.
[in a loop until EOF/EOD, of course...]
Note: the code above is simply being "paranoid" ;) -- I *think* pre-loading
the input buffer with spaces may not be needed...
Of course, if the CR/LF thing is "still a problem", you might have to do
some string manipulation/searching for the "original" CR/LF and replace them
with spaces, i.e.,
INSPECT VAR-BUFFER
REPLACING ALL %15 WITH SPACES
ALL %12 WITH SPACES.
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|