<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Usinge MIME within a PIPE in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251078#M40324</link>
    <description>For years I've created DCL scripts with embedded MIME cmds to create files with attachments.  I'd like to be able to include a small amount of text in the body of the msg.  I tried the following test:&lt;BR /&gt;&lt;BR /&gt;$ PIPE WRITE SYS$OUTPUT "Test" | ( MIME ; NEW mimefile.out ; ADD attachment ; SAVE ; EXIT )&lt;BR /&gt;&lt;BR /&gt;The mimefile.out contains an "inline" section for the msg text, but no msg.  I'm guessing that after the MIME NEW cmd opens its editor, the EOF from the incoming PIPE connection causes the editor to exit w/o saving the text.&lt;BR /&gt;&lt;BR /&gt;Any suggestions?  (I've looked at SFF (Send From File), but that would require much more coding)&lt;BR /&gt;&lt;BR /&gt;TIA</description>
    <pubDate>Tue, 10 Aug 2010 16:37:20 GMT</pubDate>
    <dc:creator>Jack Trachtman</dc:creator>
    <dc:date>2010-08-10T16:37:20Z</dc:date>
    <item>
      <title>Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251078#M40324</link>
      <description>For years I've created DCL scripts with embedded MIME cmds to create files with attachments.  I'd like to be able to include a small amount of text in the body of the msg.  I tried the following test:&lt;BR /&gt;&lt;BR /&gt;$ PIPE WRITE SYS$OUTPUT "Test" | ( MIME ; NEW mimefile.out ; ADD attachment ; SAVE ; EXIT )&lt;BR /&gt;&lt;BR /&gt;The mimefile.out contains an "inline" section for the msg text, but no msg.  I'm guessing that after the MIME NEW cmd opens its editor, the EOF from the incoming PIPE connection causes the editor to exit w/o saving the text.&lt;BR /&gt;&lt;BR /&gt;Any suggestions?  (I've looked at SFF (Send From File), but that would require much more coding)&lt;BR /&gt;&lt;BR /&gt;TIA</description>
      <pubDate>Tue, 10 Aug 2010 16:37:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251078#M40324</guid>
      <dc:creator>Jack Trachtman</dc:creator>
      <dc:date>2010-08-10T16:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251079#M40325</link>
      <description>&lt;!--!*#--&gt;I've probably never used MIME to send&lt;BR /&gt;anything (it has enough problems unpacking&lt;BR /&gt;messages), so I know nothing, but the HELP&lt;BR /&gt;(NEW /EDIT) suggests that NEW /NOEDIT might&lt;BR /&gt;be useful.  Otherwise, if it's using&lt;BR /&gt;MAIL$EDIT, you might be able to define that&lt;BR /&gt;(in this context) to something artificial&lt;BR /&gt;which would do what you want.</description>
      <pubDate>Tue, 10 Aug 2010 16:48:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251079#M40325</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-08-10T16:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251080#M40326</link>
      <description>( MIME ; NEW mimefile.out ; ADD attachment ; SAVE ; EXIT )&lt;BR /&gt;&lt;BR /&gt;this is sequentially executing the DCL commands MIME, then NEW, ADD, SAVE, EXIT,&lt;BR /&gt;NOT the MIME sub-commands desired.&lt;BR /&gt;The pipe text "test" will be input to MIME, interpreted as an unknown command by MIME.&lt;BR /&gt;&lt;BR /&gt;What are You trying to achieve ?&lt;BR /&gt;If you want to send mail attachments from a DCL command-line, then there were several threads here in ITRC forum, on dcl.openvms.org,&lt;BR /&gt;or my version at&lt;BR /&gt; &lt;A href="http://wwwvms.mpp.mpg.de/~huber/util/com/send_attach.com" target="_blank"&gt;http://wwwvms.mpp.mpg.de/~huber/util/com/send_attach.com&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Basically, you have to create a dummy/empty mime output file, and a command-file containing the ADD commands and the final SAVE,&lt;BR /&gt;then MAIL this resulting MIME output file.&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Aug 2010 18:11:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251080#M40326</guid>
      <dc:creator>Joseph Huber_1</dc:creator>
      <dc:date>2010-08-10T18:11:32Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251081#M40327</link>
      <description>Joseph - you're right, my example was invalid for a PIPE stream.&lt;BR /&gt;&lt;BR /&gt;But I've found a solution (though not as efficient as I'd hoped), which does allow me to include a msg body along w/an attached file:&lt;BR /&gt;&lt;BR /&gt;$       CREATE   MSGBODY.TXT&lt;BR /&gt;THIS IS THE BODY&lt;BR /&gt;$       WS :== WRITE SYS$OUTPUT&lt;BR /&gt;$       PIPE    ( WS "NEW MIME.OUT" ; -&lt;BR /&gt;WS "INCLUDE MSGBODY.TXT" ; -&lt;BR /&gt;WS "EXIT" ; -&lt;BR /&gt;WS "ADD attachement " ; -&lt;BR /&gt;WS "SAVE" ; -&lt;BR /&gt;WS "EXIT" ) | MIME&lt;BR /&gt;$       MAIL MSGBODY.TXT ...</description>
      <pubDate>Tue, 10 Aug 2010 21:19:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251081#M40327</guid>
      <dc:creator>Jack Trachtman</dc:creator>
      <dc:date>2010-08-10T21:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251082#M40328</link>
      <description>Jack,&lt;BR /&gt;&lt;BR /&gt;  I'm not certain I've worked out what you want "Test" to do. You can get somewhere with:&lt;BR /&gt;&lt;BR /&gt;$ WO="WRITE SYS$OUTPUT"&lt;BR /&gt;$ PIPE (wo "NEW/NOEDIT mimefile.out" ; -&lt;BR /&gt;        wo "ADD attachment" ; -&lt;BR /&gt;        wo "SAVE" ; -&lt;BR /&gt;        wo "EXIT") | -&lt;BR /&gt;  MCR MIME&lt;BR /&gt;&lt;BR /&gt;This is equivalent to:&lt;BR /&gt;&lt;BR /&gt;$ MCR MIME&lt;BR /&gt;$ DECK&lt;BR /&gt;NEW/NOEDIT mimefile.out&lt;BR /&gt;ADD attachment&lt;BR /&gt;SAVE&lt;BR /&gt;EXIT&lt;BR /&gt;$ EOD&lt;BR /&gt;&lt;BR /&gt;The difference is the PIPE construct allows you to modify the commands with symbol substitutions.&lt;BR /&gt;&lt;BR /&gt;Note that the ADD command expects a filespec. I think you can do what I think you want, but it's a bit weird. Note that the attachments don't get processed until after the SAVE command. Try this:&lt;BR /&gt;&lt;BR /&gt;$ WO="WRITE SYS$OUTPUT"&lt;BR /&gt;$ PIPE (WO "Line 1" ; WO "Line 2") |-&lt;BR /&gt;       (WO "NEW/NOEDIT mimefile.out" ;-&lt;BR /&gt;        WO "ADD SYS$PIPE" ;-&lt;BR /&gt;        WO "SAVE" ;-&lt;BR /&gt;        COPY SYS$PIPE SYS$OUTPUT) |-&lt;BR /&gt;        MCR MIME&lt;BR /&gt;&lt;BR /&gt;So, the trick is the SAVE command immediately follows ADD SYS$PIPE, then you send the output from the first pipe stage as the text of the attachment. This may seem a bit backwards, but think carefully about where the SYS$PIPEs get evaluated and you may make sense of it.&lt;BR /&gt;&lt;BR /&gt;If the segments get too complex, remember your pipe segments can execute command procedures, so you could write:&lt;BR /&gt;&lt;BR /&gt;$ PIPE @GEN_CONTENT | @MIME_COMMANDS | MCR MIME&lt;BR /&gt;&lt;BR /&gt;I often do this with a single procedure, using the first parameter as a flag to choose an execution path. For example:&lt;BR /&gt;&lt;BR /&gt;$ self=F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))&lt;BR /&gt;$ IF F$EXTRACT(0,1,p1).EQS."#"&lt;BR /&gt;$ THEN&lt;BR /&gt;$   target=p1-"#"&lt;BR /&gt;$   GOTO 'target'&lt;BR /&gt;$ ENDIF&lt;BR /&gt;$&lt;BR /&gt;$   PIPE @'self' #CONTENT | @'self' #CMDS | MCR MIME&lt;BR /&gt;$ EXIT&lt;BR /&gt;$&lt;BR /&gt;$ CONTENT:&lt;BR /&gt;$   WRITE SYS$OUTPUT F$TIME()&lt;BR /&gt;$   WRITE SYS$OUTPUT "Line2"&lt;BR /&gt;$   WRITE SYS$OUTPUT "Line3"&lt;BR /&gt;$ EXIT&lt;BR /&gt;$&lt;BR /&gt;$ CMDS:&lt;BR /&gt;$   WRITE SYS$OUTPUT "NEW/NOEDIT mimefile.out"&lt;BR /&gt;$   WRITE SYS$OUTPUT "ADD SYS$PIPE"&lt;BR /&gt;$   WRITE SYS$OUTPUT "SAVE"&lt;BR /&gt;$   COPY SYS$PIPE SYS$OUTPUT) |-&lt;BR /&gt;$ EXIT&lt;BR /&gt;&lt;BR /&gt;Not really necessary in this case, as there are no loops, conditionals or other complexities in the pipe segments, but it illustrates the principle.</description>
      <pubDate>Tue, 10 Aug 2010 21:48:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251082#M40328</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-08-10T21:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251083#M40329</link>
      <description>Jack, (was I too late?)&lt;BR /&gt;&lt;BR /&gt;&amp;gt;(though not as efficient as I'd hoped),&lt;BR /&gt;&lt;BR /&gt;  Don't be so sure. PIPE is often significantly more expensive than using temporary files. Personally I hate using scratch files because you spend too much code cleaning them up, and dealing with failure paths, making sure files are closed, etc...&lt;BR /&gt;&lt;BR /&gt;  However, if you must make a temporary, there are new tools to help deal with issues of uniqueness, process threads and recursion. Here's what I usually do:&lt;BR /&gt;&lt;BR /&gt;at the start of the procedure:&lt;BR /&gt;&lt;BR /&gt;$ self=F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))&lt;BR /&gt;$ name=F$PARSE(self,,,"NAME")&lt;BR /&gt;$ u=F$PARSE(F$UNIQUE(),"SYS$SCRATCH:.TMP;")&lt;BR /&gt;&lt;BR /&gt;generate filenames:&lt;BR /&gt;&lt;BR /&gt;$ tmp=F$PARSE(".''name'_TMP;",u)&lt;BR /&gt;$ t1=F$PARSE(".''name'_T1;",u)&lt;BR /&gt;$ msgbody=F$PARSE(".''name'_MSGBODY;",u)&lt;BR /&gt;&lt;BR /&gt;at exit look for and delete all temp files from this invokation:&lt;BR /&gt;&lt;BR /&gt;$ ufiles=F$PARSE("."+name+"_*;*",u)&lt;BR /&gt;$ IF F$SEARCH(ufiles).NES."" THEN DELETEX 'ufiles'&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Aug 2010 22:03:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251083#M40329</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-08-10T22:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251084#M40330</link>
      <description>John,&lt;BR /&gt;&lt;BR /&gt;This is a cool idea:&lt;BR /&gt;&lt;BR /&gt;$ WO="WRITE SYS$OUTPUT"&lt;BR /&gt;$ PIPE (WO "Line 1" ; WO "Line 2") |-&lt;BR /&gt;(WO "NEW/NOEDIT mimefile.out" ;-&lt;BR /&gt;WO "ADD SYS$PIPE" ;-&lt;BR /&gt;WO "SAVE" ;-&lt;BR /&gt;COPY SYS$PIPE SYS$OUTPUT) |-&lt;BR /&gt;MCR MIME&lt;BR /&gt;&lt;BR /&gt;but unfortunately not quite what I need.&lt;BR /&gt;&lt;BR /&gt;Let me start over w/an interactive example:&lt;BR /&gt;&lt;BR /&gt;$ MIME&lt;BR /&gt;MIME&amp;gt; NEW mime.out&lt;BR /&gt;* INSERT&lt;BR /&gt;(editor opens and accepts input until)&lt;BR /&gt;^Z&lt;BR /&gt;* EXIT&lt;BR /&gt;MIME&amp;gt; ADD attached.file&lt;BR /&gt;MIME&amp;gt; SAVE&lt;BR /&gt;MIME&amp;gt; EXIT&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;Examining the mime.out file shows that everything entered into the editor goes into the body of the msg, the ADD cmd attaches a file.&lt;BR /&gt;&lt;BR /&gt;I'm trying to figure out the sequence of PIPE cmds so that I can replicate the above.  Your example above seems close, but trying the following variation isn't working for me:&lt;BR /&gt;&lt;BR /&gt;$ WO="WRITE SYS$OUTPUT"&lt;BR /&gt;$ PIPE (WO "Line 1" ; WO "Line 2") |-&lt;BR /&gt;(WO "NEW mimefile.out" ;-&lt;BR /&gt;WO "INCLUDE SYS$PIPE" ;-&lt;BR /&gt;COPY SYS$PIPE SYS$OUTPUT ;-&lt;BR /&gt;WO "EXIT"&lt;BR /&gt;WO "ADD attachment" ;-&lt;BR /&gt;WO "SAVE" |-&lt;BR /&gt;MCR MIME&lt;BR /&gt;</description>
      <pubDate>Tue, 10 Aug 2010 22:32:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251084#M40330</guid>
      <dc:creator>Jack Trachtman</dc:creator>
      <dc:date>2010-08-10T22:32:21Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251085#M40331</link>
      <description>Jack,&lt;BR /&gt;&lt;BR /&gt;  That can be done too... but it's a bit weirder. The NEW/EDIT qualifier accepts a DCL command, which is appended with the filespec of a file to be created. It can be any command, including a call to a procedure, with additional parameters.&lt;BR /&gt;&lt;BR /&gt;  So here's a new procedure which calls itself to create the message body.&lt;BR /&gt;&lt;BR /&gt;$ verf='F$VERIFY(F$TRNLNM(F$PARSE(F$ENVIRONMENT("PROCEDURE"),,,"NAME")+"_VERIFY"))&lt;BR /&gt;$ self=F$PARSE(";",F$ENVIRONMENT("PROCEDURE"))&lt;BR /&gt;$ stat=1&lt;BR /&gt;$ IF F$EXTRACT(0,1,p1).EQS."#"&lt;BR /&gt;$ THEN&lt;BR /&gt;$   target=p1-"#"&lt;BR /&gt;$   GOTO 'target'&lt;BR /&gt;$ ENDIF&lt;BR /&gt;$&lt;BR /&gt;$   SomeText="From main"&lt;BR /&gt;$   PIPE @'self' #CMDS "mimefile.out" "attach1" "attach2" | MCR MIME&lt;BR /&gt;$   stat=$STATUS&lt;BR /&gt;$ GOTO FinExit&lt;BR /&gt;$&lt;BR /&gt;$ CREATE:&lt;BR /&gt;$   @'self'/OUTPUT='p2' #CONTENT "''SomeText'"&lt;BR /&gt;$ GOTO FinExit&lt;BR /&gt;$&lt;BR /&gt;$ CONTENT:&lt;BR /&gt;$   WRITE SYS$OUTPUT F$TIME()&lt;BR /&gt;$   WRITE SYS$OUTPUT "Line2"&lt;BR /&gt;$   WRITE SYS$OUTPUT "Line3"&lt;BR /&gt;$   WRITE SYS$OUTPUT p2&lt;BR /&gt;$ GOTO FinExit&lt;BR /&gt;$&lt;BR /&gt;$ CMDS:&lt;BR /&gt;$   WRITE SYS$OUTPUT "NEW/EDIT=""@''self' #CREATE"" ''p2'"&lt;BR /&gt;$   i=3&lt;BR /&gt;$   AttachLoop: attach=p'i'&lt;BR /&gt;$   IF attach.NES.""&lt;BR /&gt;$   THEN&lt;BR /&gt;$     WRITE SYS$OUTPUT "ADD ''attach'"&lt;BR /&gt;$     i=i+1&lt;BR /&gt;$     IF i.LE.8 THEN GOTO AttachLoop&lt;BR /&gt;$   ENDIF&lt;BR /&gt;$   WRITE SYS$OUTPUT "SAVE"&lt;BR /&gt;$ GOTO FinExit&lt;BR /&gt;$&lt;BR /&gt;$ FinExit:&lt;BR /&gt;$ $ EXIT %X10000000.OR.F$INTEGER(stat)+(F$VERIFY(verf).AND.0)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In terms of "efficiency", the reality of the way MIME works is, no matter how you code it, it doesn't avoid temporary files. Done this way they're hidden from you and you don't need to clean them up. Also note my trick of using /OUTPUT to create an output file, rather than OPEN/WRITE and CLOSE - this avoids leaving PPFs open if the procedure exits abnormally.&lt;BR /&gt;&lt;BR /&gt;I've also added some code to illustrate how you can pass parameters into the pipe branches, and also how to turn off verify (necessary now because the /OUTPUT would otherwise include verification if it were enabled).&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Note to take this to it's absurd conclusion, I tried this:&lt;BR /&gt;&lt;BR /&gt;$ WO="WRITE SYS$OUTPUT"&lt;BR /&gt;$ PIPE (WO "Line 1" ; WO "Line 2") |(in=F$TRNLNM("SYS$PIPE") ; WO "NEW/EDIT=""COPY ",in,""" mimefile.out" ; WO "ADD attachment" ; WO "SAVE") | MCR MIME&lt;BR /&gt;&lt;BR /&gt;In theory it should work, as the 3rd pipe segment can read from the first, BUT the timing of the pipe processes is such that by the time the 3rd segment is executing the COPY command, the first and second segments have exited and the pipe between them has been closed. You can prove the point with a delay at the end of the second segment, but I wouldn't depend on it!&lt;BR /&gt;&lt;BR /&gt;PIPE (WO "Line 1" ; WO "Line 2") | (in=F$TRNLNM("SYS$PIPE") ;  WO "NEW/EDIT=""COPY ",in,""" mimefile.out" ;  WO "ADD attach&lt;BR /&gt;ment" ; WO "SAVE" ; wait 00:00:01) | mcr mime&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Aug 2010 00:47:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251085#M40331</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-08-11T00:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251086#M40332</link>
      <description>&lt;!--!*#--&gt;&amp;gt; I've probably never used MIME to send&lt;BR /&gt;&amp;gt; anything (it has enough problems unpacking&lt;BR /&gt;&amp;gt; messages), so I know nothing, [...]&lt;BR /&gt;&lt;BR /&gt;Also among the programs which I don't use to&lt;BR /&gt;send anything, and so of which I know&lt;BR /&gt;nothing, is a VMS-compatible [*] edition of&lt;BR /&gt;mpack:&lt;BR /&gt;&lt;BR /&gt;      &lt;A href="http://antinode.info/dec/sw/mpack.html" target="_blank"&gt;http://antinode.info/dec/sw/mpack.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;[*] The build procedure should work.&lt;BR /&gt;&lt;BR /&gt;On the bright side, munpack has done better&lt;BR /&gt;at unpacking a few things than has MIME, but&lt;BR /&gt;you're on your own so far as figuring out&lt;BR /&gt;what to do with mpack.  I assume that you'd&lt;BR /&gt;need to enlist the SFF stuff, too, if you&lt;BR /&gt;actually wanted anything sent out.</description>
      <pubDate>Wed, 11 Aug 2010 02:50:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251086#M40332</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-08-11T02:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251087#M40333</link>
      <description>I'm not clear on the use/purpose of the NEW/EDIT="DCL cmd" option.  Does this simply spawn a subprocess &amp;amp; execute the DCL?  How is this useful - couldn't the DCL simply be run before the MIME program is run?&lt;BR /&gt;&lt;BR /&gt;Anyway, from what I've read, there seems to be no way to pass some text to the MIME program that will wind up in the body of the msg.  Correct?</description>
      <pubDate>Wed, 11 Aug 2010 16:21:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251087#M40333</guid>
      <dc:creator>Jack Trachtman</dc:creator>
      <dc:date>2010-08-11T16:21:58Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251088#M40334</link>
      <description>&lt;!--!*#--&gt;&amp;gt; [...] How is this useful [...]?&lt;BR /&gt;&lt;BR /&gt;It gets its result into MIME without being an&lt;BR /&gt;interactive editor (requiring user action for&lt;BR /&gt;proper operation)?</description>
      <pubDate>Wed, 11 Aug 2010 17:13:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251088#M40334</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2010-08-11T17:13:22Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251089#M40335</link>
      <description>&amp;gt;Anyway, from what I've read, there seems to &lt;BR /&gt;&amp;gt;be no way to pass some text to the MIME &lt;BR /&gt;&amp;gt;program that will wind up in the body of &lt;BR /&gt;&amp;gt;the msg. Correct?&lt;BR /&gt;&lt;BR /&gt;  Not correct. It does exactly what you want. The /EDIT= command creates the body of the message. The parameter passed to the command is a file name generated by MIME which it uses as the message body. &lt;BR /&gt;&lt;BR /&gt;  The procedure in my last reply gives you a 10 point answer. All the mechanisms you need to do precisely what you requested, using PIPE, 100% of the time.&lt;BR /&gt;&lt;BR /&gt;If you're brave, you could also use the final PIPE command to do it in the least amount of code:&lt;BR /&gt;&lt;BR /&gt;PIPE (WO "Line 1" ; WO "Line 2") | (in=F$TRNLNM("SYS$PIPE") ; WO "NEW/EDIT=""COPY ",in,""" mimefile.out" ; WO "ADD attachment" ; WO "SAVE" ; WAIT 00:00:01) | MCR MIME&lt;BR /&gt;&lt;BR /&gt;The body of your message is &lt;BR /&gt;Line 1&lt;BR /&gt;Line 2&lt;BR /&gt;&lt;BR /&gt;BUT you're depending on the 1 second delay in the second pipe stage to be long enough for the third pipe stage to kick off and start reading from the first stage. It's probably a 99.99% solution, but some day on a very busy system it will fail (I experimented with other mechanisms to synchronise the processes, but couldn't find one).</description>
      <pubDate>Wed, 11 Aug 2010 21:13:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251089#M40335</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-08-11T21:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251090#M40336</link>
      <description>Yet another way - as a one liner:&lt;BR /&gt;&lt;BR /&gt;PIPE (-&lt;BR /&gt;WO "NEW/EDIT=""PIPE (WO """"Body1"""" ; WO """"Body2"""")|COPY SYS$PIPE"" mimefile.out" ; WO "ADD attachment" ; WO "SA&lt;BR /&gt;VE") | MCR MIME&lt;BR /&gt;&lt;BR /&gt;Be careful with quotes!</description>
      <pubDate>Wed, 11 Aug 2010 21:24:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251090#M40336</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-08-11T21:24:47Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251091#M40337</link>
      <description>Sorry John, I'm just not groking how to use the /EDIT=dcl function.  The MIME help text example is not clear to me.&lt;BR /&gt;&lt;BR /&gt;So lets say I have file msg.txt that I want MIME to put into the msg body part of some file. along w/an attached file.  What would I use:&lt;BR /&gt;&lt;BR /&gt;$ MIME&lt;BR /&gt;MIME&amp;gt; NEW/EDIT=???&lt;BR /&gt;MIME&amp;gt; ADD attachement&lt;BR /&gt;MIME&amp;gt; SAVE&lt;BR /&gt;MIME&amp;gt; EXIT</description>
      <pubDate>Wed, 11 Aug 2010 21:54:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251091#M40337</guid>
      <dc:creator>Jack Trachtman</dc:creator>
      <dc:date>2010-08-11T21:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251092#M40338</link>
      <description>Jack,&lt;BR /&gt;&lt;BR /&gt;&amp;gt; I'm just not groking how to use &amp;gt;the /EDIT=dcl function&lt;BR /&gt;&lt;BR /&gt;Yes, MIME has chosen a rather odd way to do the message body. I can see why you might have trouble groking. And I agree, the help text isn't very helpful.&lt;BR /&gt;&lt;BR /&gt;Perhaps this will help...&lt;BR /&gt;&lt;BR /&gt;MIME&amp;gt; NEW myfile&lt;BR /&gt;&lt;BR /&gt;creates "myfile" with MIME headers, yes? The default is /EDIT which invokes a default interactive text editor to create the body text. However, the /EDIT qualifier is more general than that, it can be any command which creates a file. If you type:&lt;BR /&gt;&lt;BR /&gt;MIME&amp;gt; NEW/EDIT="MYCOMMAND" myfile&lt;BR /&gt;&lt;BR /&gt;the MIME command executes your command (presumably with SPAWN), appended with the name of a temporary file. Something like:&lt;BR /&gt;&lt;BR /&gt;$ MYCOMMAND SYS$SCRATCH:MIME$656F_MSG.TXT&lt;BR /&gt;&lt;BR /&gt;Note that the file doesn't exist when the command is invoked. If it exists when the command completes, it will be inserted into the MIME file as the message body. It appears this is the only mechanism for specifying the message body.&lt;BR /&gt;&lt;BR /&gt;So you can see how the default action is really just /EDIT="EDIT/EDT", resulting in:&lt;BR /&gt;&lt;BR /&gt;$ EDIT/EDT SYS$SCRATCH:MIME$656F_MSG.TXT&lt;BR /&gt;&lt;BR /&gt;&amp;gt;So lets say I have file msg.txt that I want&lt;BR /&gt;&amp;gt;MIME to put into the msg body &lt;BR /&gt;&lt;BR /&gt;The simplest possibility I can think of is:&lt;BR /&gt;&lt;BR /&gt;MIME&amp;gt; NEW/EDIT="COPY MSG.TXT" mimefile.out&lt;BR /&gt;&lt;BR /&gt;That would be appended with the temp file name and become:&lt;BR /&gt;&lt;BR /&gt;$ COPY MSG.TXT SYS$SCRATCH:MIME$656F_MSG.TXT&lt;BR /&gt;&lt;BR /&gt;MIME would then include the contents of the file into the output file, and delete the temporary file.&lt;BR /&gt;&lt;BR /&gt;I too find this rather odd, it may have made more sense to have /BODY=file, but I suppose the utility was designed to be interactive. It has a kind of "swiss army knife" generality appeal, but it's also a bit klunky.&lt;BR /&gt;&lt;BR /&gt;The variations I've posted are just different ways of feeding some text into some command to generate a file, specified as the last token in the command.&lt;BR /&gt;&lt;BR /&gt;I used two command procedure to investigate what /EDIT was doing:&lt;BR /&gt;&lt;BR /&gt;TEST.COM&lt;BR /&gt;$ @TEST1 /OUTPUT=TEST.OUT "''p1'" "''p2'" "''p3'" "''p4'" "''p5'" "''p6'" "''p7'" "''p8'"&lt;BR /&gt;$ EXIT&lt;BR /&gt;&lt;BR /&gt;TEST1.COM&lt;BR /&gt;$ SHOW SYM p%&lt;BR /&gt;$ DIR 'p1'&lt;BR /&gt;$ EXIT 1&lt;BR /&gt;&lt;BR /&gt;execute a command:&lt;BR /&gt;&lt;BR /&gt;MIME&amp;gt; NEW/EDIT="@TEST" newfile&lt;BR /&gt;&lt;BR /&gt;and look in TEST.OUT. &lt;BR /&gt;&lt;BR /&gt;(BTW, I believe it's possible to reopen a thread in order to award points... ;-)</description>
      <pubDate>Wed, 11 Aug 2010 23:51:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251092#M40338</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2010-08-11T23:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251093#M40339</link>
      <description>Excellent John!  Not only have you patiently taken the time to explain the details I needed to be able to do exactly what I want, but you've educated me in some fine points!&lt;BR /&gt;&lt;BR /&gt;Last question: how do I reopen this thread so I can add points?</description>
      <pubDate>Thu, 12 Aug 2010 19:21:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251093#M40339</guid>
      <dc:creator>Jack Trachtman</dc:creator>
      <dc:date>2010-08-12T19:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251094#M40340</link>
      <description>At the top of a closed thread, the author (you) should see a "reopen thread" button, to the left of the "notify","reply" etc. buttons.&lt;BR /&gt;&lt;BR /&gt;Jon</description>
      <pubDate>Thu, 12 Aug 2010 20:01:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251094#M40340</guid>
      <dc:creator>Jon Pinkley</dc:creator>
      <dc:date>2010-08-12T20:01:27Z</dc:date>
    </item>
    <item>
      <title>Re: Usinge MIME within a PIPE</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251095#M40341</link>
      <description>Thanks again</description>
      <pubDate>Thu, 12 Aug 2010 20:57:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/usinge-mime-within-a-pipe/m-p/5251095#M40341</guid>
      <dc:creator>Jack Trachtman</dc:creator>
      <dc:date>2010-08-12T20:57:21Z</dc:date>
    </item>
  </channel>
</rss>

