convert like a VMS?

convert like a VMS?

Post by pe.. » Sun, 18 Nov 2001 07:15:42




> I have a need to do something that the VMS system is doing now in unix.
> There is a program in VMS called convert that will take a control file and
> input file and convert it to a different format.  How can I do this in Unix?
> Is there a convert?  Basicly I need to take this report and convert it to
> have a cr return in the first position and a fixed length of 133.   I can
> send the vms convert control file if needed.

If this is for printing from a printer attatched direct or via
a network connection, the right place is to create a printer filter.

(Unix has no use for "carridge-control printer files", but
has lot's of tools for converting one data format to another)

Whats the format of your input ? And what is the usage of it ?

> begin 666 BATCH_BARCODE_REPORT.FDL













> `
> end

--
Peter H?kanson        
        IPSec  Sverige      (At the Riverside of Gothenburg, home of Volvo)
           Sorry about my e-mail address, but i'm trying to keep spam out.
           Remove "icke-reklam"and "invalid"  and it works.
 
 
 

convert like a VMS?

Post by Tony Reeve » Sun, 18 Nov 2001 07:39:51


The format is to be uploaded to an IBM Mainframe for use on it. And I
understand that the IBM does not understand the cr control that is in there
now. plus the report must be a fixed size of 133



> > I have a need to do something that the VMS system is doing now in unix.
> > There is a program in VMS called convert that will take a control file
and
> > input file and convert it to a different format.  How can I do this in
Unix?
> > Is there a convert?  Basicly I need to take this report and convert it
to
> > have a cr return in the first position and a fixed length of 133.   I
can
> > send the vms convert control file if needed.

> If this is for printing from a printer attatched direct or via
> a network connection, the right place is to create a printer filter.

> (Unix has no use for "carridge-control printer files", but
> has lot's of tools for converting one data format to another)

> Whats the format of your input ? And what is the usage of it ?

> > begin 666 BATCH_BARCODE_REPORT.FDL













> > `
> > end

> --
> Peter H?kanson
>         IPSec  Sverige      (At the Riverside of Gothenburg, home of
Volvo)
>            Sorry about my e-mail address, but i'm trying to keep spam out.
>    Remove "icke-reklam"and "invalid"  and it works.


 
 
 

convert like a VMS?

Post by Andreas Karre » Sun, 18 Nov 2001 09:19:53



> I have a need to do something that the VMS system is doing now in unix.
> There is a program in VMS called convert that will take a control file and
> input file and convert it to a different format.

VMS has analyze/convert primarily because there are so many different
file formats. If I remember correctly, a simple text file can be in one
of 5 or more formats (stream-LF, stream-CR, CR-fixed, Fortran Carriage
Control...).

Under Unix, files are sequences of bytes. The file system or the
operation system imposes no structure and no restrictions on the contents.
Most Unix utilities, however, assume text files to be in a format that VMS
would call stream-LF; lines of characters that end in LF. LF is often
called newline (NL) in Unix speak.

Quote:>  How can I do this in Unix?

You'd write a small program, most likely in Perl.

Quote:> Is there a convert?  Basicly I need to take this report and convert it to
> have a cr return in the first position and a fixed length of 133.   I can
> send the vms convert control file if needed.

I assume lines should have a LF at the end, should be blank-padded, and
lines longer than 133 chars should be chopped at the end. Then:

  % perl -ne 'chomp;printf "\r%-133.133s\n",$_' < infile > outfile

  ( chomp        chops the terminating LF off the input line
    \r           outputs the CR at the begin of line
    %-133.133s   is a left-adjusted output field for a string that is
                 exactly 133 chars wide, blank-padded at the right side
                 if shorter, chopped at the right if longer.
    \n           is the LF at the end of the output line.
    $_           contains the line just read, minus the LF that was chomped off)

 - Andi

 
 
 

convert like a VMS?

Post by Jerry Peter » Mon, 19 Nov 2001 06:56:04



> The format is to be uploaded to an IBM Mainframe for use on it. And I
> understand that the IBM does not understand the cr control that is in there
> now. plus the report must be a fixed size of 133

If you use ftp, the ftp server on the IBM mainframe will handle many
of these details for you automatically, including the ascci to ebcdic
conversion. IBM has most of their manuals available online, you need
to look at something like the TCP/IP Users Guide, IIRC. Start here:
http://www.ibm.com/software/  

        Jerry




>> > I have a need to do something that the VMS system is doing now in unix.
>> > There is a program in VMS called convert that will take a control file
> and
>> > input file and convert it to a different format.  How can I do this in
> Unix?
>> > Is there a convert?  Basicly I need to take this report and convert it
> to
>> > have a cr return in the first position and a fixed length of 133.   I
> can
>> > send the vms convert control file if needed.

>> If this is for printing from a printer attatched direct or via
>> a network connection, the right place is to create a printer filter.

>> (Unix has no use for "carridge-control printer files", but
>> has lot's of tools for converting one data format to another)

>> Whats the format of your input ? And what is the usage of it ?

>> > begin 666 BATCH_BARCODE_REPORT.FDL













>> > `
>> > end

>> --
>> Peter H?kanson
>>         IPSec  Sverige      (At the Riverside of Gothenburg, home of
> Volvo)
>>            Sorry about my e-mail address, but i'm trying to keep spam out.
>>    Remove "icke-reklam"and "invalid"  and it works.