From:	CSBVAX::CSBVAX::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX"  4-DEC-1988 08:52
To:	MRGATE::"ARISIA::EVERHART"
Subj:	RE: VFC to Variable length


Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Wed, 30 NOV 88 01:33:04 PDT
Received: from CUNYVM.CUNY.EDU by KL.SRI.COM with TCP; Wed, 30 Nov 88 01:24:15 PST
Received: from NIHKLMB.BITNET by CUNYVM.CUNY.EDU (IBM VM SMTP R1.1) with BSMTP id 8863; Wed, 30 Nov 88 04:13:24 EDT
Date: Mon, 28 Nov 88 15:47 EST
From: Gerson H Cohen <GHC%NIHKLMB.BITNET@CUNYVM.CUNY.EDU>
Subject: RE: VFC to Variable length
To: INFO-VAX@KL.SRI.COM
X-VMS-To: IN%"INFO-VAX@KL.SRI.COM",GHC

> Received: from ANJE-DAEMON by NIHKLMB.BITNET; Mon, 28 Nov 88 08:51 EST
> Received: From PSUVM(MAILER) by NIHKLMB for GHC@NIHKLMB; Mon, 28 Nov 88 08:51
>  EST
> Received: by PSUVM (Mailer X1.25) id 5751; Mon, 28 Nov 88 08:48:47 EST
> Date: Fri, 25 Nov 88 22:59:22 GMT
> From: Erland Sommarskog <mcvax!enea!sommar@UUNET.UU.NET>
> Subject: VFC to Variable length
> Sender: INFO-VAX Discussion <INFO-VAX@VTVM2.BITNET>
> To: GERSON H COHEN <GHC@NIHKLMB.BITNET>
> Reply-to: INFO-VAX@KL.SRI.COM
> Comments: Warning -- original Sender: tag was info-vax-request@KL.SRI.COM
> Comments: To: info-vax@kl.sri.com
>
>
> We're using Cobol to generate reports in our projects and these files
> gets the VFC format for some reason. Now, a colleague of mine got
> this idea he wanted to read them in the editor. And, yes, you can.
> Both EDT and TPU even nicely converts them to standard variable-length
> format if you modify them. The problem is that they don't understand
> the embedded carriage control, so the result is a compressed file.
> Lines you haven't explicitly written to are omitted. In my naivety
> I thought CONVERT/FDL was the thing, but it wasn't. Same problem there.
>
> Anyone who has an idea?
> --
> Erland Sommarskog
> ENEA Data, Stockholm
> sommar@enea.se
> "Frequently, unexpected errors are entirely unpredictable" - Digital Equipment

I wrote a program to do the same conversion of Batch logs some while
ago.  It is a paraphrase of one of the DEC examples in the RMS manual
of the time.  Perhaps it can suit your need:
===================================cut========================================
        .title cvtlog
rec_size=512
rhb_size=2
        .psect data,long
infab:  $fab    fnm=<infile:>
inrab:  $rab    fab=infab,-
                rhb=rec_header,-
                ubf=rec_buffer+1,-
                usz=rec_size-1
outfab: $fab    fnm=<outfile:>,-
                rfm=var,-
                mrs=512,-
                rat=ftn
outrab: $rab    fab=outfab,-
                rbf=rec_buffer
rec_header:     .blkb   rhb_size
rec_buffer:     .blkb   rec_size
        .psect  code,nowrt
start:  .word   0
        $open   fab=infab
        blbs    r0,1$
        jmp     exit
1$:
        $create fab=outfab
        blbs    r0,2$
        jmp     exit
2$:
        $connect        rab=inrab
        blbs    r0,4$
        jmp     exit
4$:
        $connect        rab=outrab
        blbs    r0,5$
        jmp     exit
5$:
read:   $get    rab=inrab
        blbs    r0,5$
        jmp     exit1
5$:
;       set prefix
        bbc     #7,rec_header,10$
;       when the bit is set, we have a control character
        bicb3   #^xe0,rec_header,rec_buffer
        cmpb    #12,rec_buffer
        bneq    20$
        movb    #^a'1',rec_buffer
        brb     20$
10$:    caseb   rec_header,#0,#2
11$:    .word   12$-11$
        .word   13$-11$
        .word   14$-11$
12$:    movb    #^a'+',rec_buffer       ; no forms advance
        brb     20$
13$:    movb    #^a' ',rec_buffer       ; normal forms advance
        brb     20$
14$:    movb    #^a'0',rec_buffer       ; double forms advance
20$:
        addw3   #1,inrab+rab$w_rsz,outrab+rab$w_rsz
        $put    rab=outrab
        blbc    r0,exit
        jmp     read
exit1:  cmpl    r0,#rms$_eof
        bneq    exit
done:   $close  fab=infab
        $close  fab=outfab
exit:   $exit_s r0
        .end    start
===========================cut=================================
What follows is the command file with which I run the program.
I define the symbol CVT*LOG == "$disk:[dir]CVTLOG" at login time.
===========================cut=================================
$       VFL='F$VERIFY(0)'       ! CVTLOG.COM
$       SET ON
$       ON CONTROL_Y THEN GOTO END
$!
$!      Command procedure to make CVTLOG look like a
$!      utility known to the system.
$!
$!      The first parameter is the name of the .LOG file to be processed.
$!      The second parameter is the name of the processed file.
$!
$!      If the file type of the first parameter is not
$!      specified, it defaults to ".LOG".
$!
$!      If the second parameter is null or the file type of
$!      the first parameter is ".LOG" (either explicitly or
$!      by default) the processed file name is set the same as
$!      the .LOG file name but with a file type of ".LIS"
$!      residing in the default device and directory.  If the
$!      parameter is null and the first parameter file type
$!      is not ".LOG", a prompt is issued.
$!
$P1CHK: IF P1 .NES. "" THEN GOTO PARSE
$       INQUIRE/NOPUNCTUATION P1 "_From:        "
$       GOTO P1CHK
$!
$PARSE:
$!
$!      Replace P1 by the fully quallified name of the input file
$!
$       PP = F$PARSE(P1,".LOG") ! Supply ".LOG" as a default
$!
$!      Does this file actually exist?
$!
$       IF PP.EQS."" THEN GOTO NOP1
$       P1 = PP                 ! In case we need it for the message below
$       PP = F$SEARCH(PP)
$       IF PP.NES."" THEN GOTO P1DONE
$NOP1:
$       WRITE SYS$OUTPUT "''F$MESSAGE(%X912)': ''P1'"
$       GOTO END
$!
$P1DONE:P1 = PP
$       P1N = F$PARSE(P1,,,"NAME")
$       P1T = F$PARSE(P1,,,"TYPE")
$!
$!      Now check the second parameter which names the result file
$!
$       IF P1T.NES.".LOG" .AND. P2.EQS."" THEN -
                INQUIRE/NOPUNCTUATION P2 "_To:          "
$       P2 = F$PARSE(P2,"''P1N'.LIS")
$!
$RUNIMAGE:
$       ASSIGN/USER_MODE        'P1'    INFILE
$       ASSIGN/USER_MODE        'P2'    OUTFILE
$       ON ERROR THEN CONTINUE
$       RUN     D$:CVTLOG
$END:   IF VFL THEN SET VERIFY
===========================cut=================================

