Article 147897 of comp.os.vms:

In article <4nfmm0$qck@usenetp1.news.prodigy.com>, ZENE44A@prodigy.com (William Clark) writes...
>Question - DCX Data compression utility in use on a regular basis. Fine, 
>OK, does the job perfectly.  HOWEVER, I have failed to recreate 
>PrintFormatted files with all Printer Control (FormFeed, CarriageControl) 
>characters intact.

The print control charactes are in the two byte 'fixed control' part of 
the records. If a program issues RMS $GETs to read the records then those
bytes are NOT returned into the record buffer, but in the optional header
buffer pointed to by RAB$L_RHB. Very few tools/utilities know how to deal
with this. For example DUMP/RECORD will not show those byte. Convert uses
them optional controlled by the FIXED_CONTROL switch.
What does this mean to you? That you either have to look for a switch in
the tool to control this, or try to hide this speciall attribute for the
purpose of the compress and restore when done:

	$lrl = F$FILE (your-file,"LRL") + 2
	$SET FILE/ATTR=(RFM:VAR,RAT:CR,LRL='lrl') 'your-file'
	<process>
	$lrl = lrl - 2
	$SET FILE/ATTR=(RFM:VFC,RAT:PRN,LRL='lrl'  'your-file'

Worked out example:

	$OPEN/WRITE X TMP.TMP
	$WRITE X "test"
	$WRITE X "test"
	$CLOSE X
	$DUMP/RECORD TMP.TMP
	...Record number 1 (00000001), 4 (0004) bytes, RFA(0001,0000,0000)
 	...74736574 test............ 000000
	$DUMP/BLOCK TMP.TMP
	...    74736574 8D010006 74736574 8D010006 ....test....test 000000
	       DATA     VFC SIZE DATA     VFC SIZE\
                                                   \ Size was really 6 bytes!
	$DIR/FULL TMP.TMP
	   Record format:      VFC, 2 byte header, maximum 4 bytes
	   Record attributes:  Print file carriage control
	$
	$SET FILE/ATTR=(RFM:VAR,RAT:CR,LRL=6) TMP.TMP
	$        $DUMP/RECORD TMP.TMP
 	...Record number 1 (00000001), 6 (0006) bytes, RFA(0001,0000,0000)
	...7473 65748D01 ..test.......... 000000
	            ~~~~\
	                 \ Print control showing up in data now.
	$DIR/FULL TMP.TMP
	   Record format:      Variable length, maximum 6 bytes
	   Record attributes:  Carriage return carriage control
	$
	$!do your thing, and then restore original attributes....
	$
	$SET FILE/ATTR=(RFM:VFC,RAT:PRN,LRL=4) TMP.TMP
	$DIR/FULL TMP.TMP
           Record format:      VFC, 2 byte header, maximum 4 bytes
           Record attributes:  Print file carriage control
 	$DUMP/RECORD TMP.TMP ---> back to 4 bytes (plus two hidden ones).


Hope this helps,		+--------------------------------------+
Hein van den Heuvel, Digital.	| All opinions expressed are mine, and |
  "Makers of VMS and other	| may not reflect those of my employer |
   fine Operating Systems."	+--------------------------------------+


