Operating System - OpenVMS
1753861 Members
7557 Online
108809 Solutions
New Discussion юеВ

Re: Mime Line Length Problem

 
SOLVED
Go to solution
Jack Trachtman
Super Advisor

Mime Line Length Problem

OpenVMS V8.3
TCPIP V5.6
MIME v1.93

I've been creating CSV files in DCL, then using MIME to attach the files and send them. When the user (on a PC) clicks on the attachment, Excel opens and reads the file.

I've just discovered that if my records are longer than 132 characters, the lines get wrapped! I created a file w/lines from 130-140 characters to confirm this.

Is there any way around this?

TIA
10 REPLIES 10
John Gillings
Honored Contributor
Solution

Re: Mime Line Length Problem

Jack,

At what stage are the lines being wrapped? Check carefully.

I have a job which generates several CSV files, some of which have lines thousands of characters long. On the OpenVMS system, I then ZIP them, add the ZIP into a MIME file and send by SMTP mail. At the other end, open the ZIP and then the CSV file into Excel. No problem. The only trick was to use MIME> ADD/BINARY for the ZIP

I haven't actually tried sending the CSV directly.

In generating the CSVs from Oracle/SQLplus (now there's a misnomer!), I had all manner of problems with line lengths - ended up tagging start and end of the rows, then using a perl script to strip white space and glue the lines back together.
A crucible of informative mistakes
Joseph Huber_1
Honored Contributor

Re: Mime Line Length Problem

It must be the the receiving mail reader breaking the lines in the display.

I just did test sending a text file with lines longer than 132 characters to a linux/thunderbird system:
Thunderbird breaks the lines in display, but saving the attached file keeps the long lines intact.
http://www.mpp.mpg.de/~huber
Jack Trachtman
Super Advisor

Re: Mime Line Length Problem

Joseph,

I found the same thing - if I sent my CSV file within the body of the e-mail, I could copy the body to Notepad & save it. It would then open correctly in Excel.

John,

Zipping my files before using MIME allows me to send the longer lines.

Thanks
Joseph Huber_1
Honored Contributor

Re: Mime Line Length Problem

Jack, You probably were just happy sending long lines in the body, and receiving them intact.
Depending on the mail agents involved, this is not guaranted.
I did send it as a quoted-printable attachment:
since CSV files are text, quoted-printable is enough, and saves one step over zip+mime.
http://www.mpp.mpg.de/~huber
Steven Schweda
Honored Contributor

Re: Mime Line Length Problem

> [...] using MIME [...]

Not a very detailed description of what you
did.

> [...] the lines get wrapped!

The obvious question would be, "By whom?".

> [...] quoted-printable is enough, [...]

It's worth a try, if the ever-troublesome
MIME utility can do it right. There's also
mpack+munpack, of course.
Jack Trachtman
Super Advisor

Re: Mime Line Length Problem

The following may be useful to others:

In the MIME utility, I had been ADDing my files w/the default content-type. I have discovered that the following seems to cure my problem of lines wrapping:

$ MIME
MIME> NEW/NOEDIT outputfile
MIME> ADD/CONTENT-TYPE="text/csv" filename
...
Mike Kier
Valued Contributor

Re: Mime Line Length Problem

If you have MIME$FILETYPES.DAT in either SYS$MANAGER or your SYS$LOGIN directory the association is made automatically.

From MIME> HEMP SHOW FILE_TYPES MIME$FILETYPES.DAT:

The FILE_TYPES table is constructed from program built-in types and is read from the simple comma separated list in the MIME$FILETYPES.DAT configuration files, (if they exist).

System-wide FILE_TYPES are specified by the file SYS$MANAGER:MIME$FILETYPES.DAT and can be supplemented with additional entries found in the SYS$LOGIN:MIME$FILETYPES.DAT file.

The table is constructed beginning with the built-in types, then adding the system definitions from SYS$MANAGER:MIME$FILETYPES.DAT, and ending with data from the SYS$LOGIN:MIME$FILETYPES.DAT file.

The entries are displayed in order of the most recently defined (LIFO) entries. In the case of duplicate entries, the first entry is used. This allows a user to customize their own environment while the system manager defines a default system or site environment for all users.
Practice Random Acts of VMS Marketing
Jack Trachtman
Super Advisor

Re: Mime Line Length Problem

Mike,

Was the file MIME$FILETYPES.DAT supposed to have been automatically installed, or am I supposed to create it following the example in the MIME HELP SHOW FILE_TYPES? It doesn't exist on my systems.
Mike Kier
Valued Contributor

Re: Mime Line Length Problem

I'm not sure where ours came from, but you can get a reasonably good one from http://wwwvms.mppmu.mpg.de/vms$common/sysmgr/mime$filetypes.dat
Practice Random Acts of VMS Marketing