To de-block text files from HP LIF disks none of the many options of DEBLOCK was suitable. Structured fields is quite close, but the length of the length field is not included in the length. In addition records of odd length are padded with one byte so next length field starts on an even byte. Null records and end of file are coded by a length field only containing 'fffe'x ore 'ffff' respectively. I made a simple REXX for it that works fine, Alas for small files only. "Big" files reveal a bad performance and in addition, disconnecting output does not stop de-blocking the whole file. What do I wrong here:
> trace o > signal on error > 'EOFREPORT ANY' > > "ADDPIPE *.input:!fblock 1!*.input:' > "ADDPIPE *.output:!xlate from 819 to 273!*.output:' > 'PEEKTO' > do forever > 'CALLPIPE (end ?) *:', > '! join', /* two bytes one word */ > '!a:strwhile xfffe' !!, /* a null record marker? */ > '! chop 0', /* make it an empty line */ > '!*:', > '?a:', /* from STRWHILElabel */ > '! var ln' /* save record length */ > if ln = 'ffff'x then leave /* quit if EOF */ > ln = c2d(ln) /* length of record */ > 'CALLPIPE *:', > '!take' ln, /* sip some bytes */ > '!join *', /* string them to one line */ > '!*:' > if ln // 2 then 'READTO' /* remove filler of odd length lines */ > end /* next record */ > error: > exit (RC * (RC ^= 12 & RC ^= 8)) Ciao.....Mike -- www.Ok.de - die kostenlose E-Mail Adresse
