<?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 Re: F$ENV(&amp;quot;PROCEDURE&amp;quot;) in detached process in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101838#M43654</link>
    <description>The discussion gave me an idea how to solve the issue.</description>
    <pubDate>Mon, 07 Apr 2008 13:32:17 GMT</pubDate>
    <dc:creator>Teofil Smolowicz</dc:creator>
    <dc:date>2008-04-07T13:32:17Z</dc:date>
    <item>
      <title>F$ENV("PROCEDURE") in detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101827#M43643</link>
      <description>F$ENV("PROCEDURE") called in detached process&lt;BR /&gt;gives only NAME.TYPE instead of expected full file.spec. OpenVMS version V7.3-2. Please explain why.&lt;BR /&gt;Test comproc: (TMP.COM)&lt;BR /&gt;  $ write sys$output f$env("procedure")&lt;BR /&gt;Interactive test:&lt;BR /&gt;$ @tmp&lt;BR /&gt;USER$DISK:[EDTTSZ]TMP.COM;50&lt;BR /&gt;Detached process test:&lt;BR /&gt;$ run /input=tmp.com /out=tmp.log sys$system:loginout&lt;BR /&gt;%RUN-S-PROC_ID, identification of created process is 000DB60D&lt;BR /&gt;$ type tmp.log&lt;BR /&gt;$ write sys$output f$env("procedure")&lt;BR /&gt;TMP.COM&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Apr 2008 11:16:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101827#M43643</guid>
      <dc:creator>Teofil Smolowicz</dc:creator>
      <dc:date>2008-04-07T11:16:06Z</dc:date>
    </item>
    <item>
      <title>Re: F$ENV("PROCEDURE") in detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101828#M43644</link>
      <description>In detached sys$login is not defined (and sys$scratch neither). And your input file is sys$login:tmp.com.&lt;BR /&gt;&lt;BR /&gt;try specifying the full path and it will work.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Mon, 07 Apr 2008 11:25:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101828#M43644</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-04-07T11:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: F$ENV("PROCEDURE") in detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101829#M43645</link>
      <description>Teofil,&lt;BR /&gt;&lt;BR /&gt;Wim said it.&lt;BR /&gt;&lt;BR /&gt;But if you WANt or NEED a DCL environment in your detached process, then &lt;BR /&gt;RUN SYS$SYSTEM:LOGINOUT.EXE/INPUT=&lt;FULL filespec="" of="" .com="" file="" that="" runs="" your="" image=""&gt;/OUTPUT=&lt;WHAT will="" become="" sys=""&gt;/ERROR=&lt;WHAT will="" become="" sys=""&gt;&lt;/WHAT&gt;&lt;BR /&gt;hth&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe&lt;/WHAT&gt;&lt;/FULL&gt;</description>
      <pubDate>Mon, 07 Apr 2008 12:07:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101829#M43645</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2008-04-07T12:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: F$ENV("PROCEDURE") in detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101830#M43646</link>
      <description>Both SYS$LOGIN and SYS$SCRATCH are defined.&lt;BR /&gt;New test with this com.proc.&lt;BR /&gt;  $ set nover&lt;BR /&gt;  $ show log sys$login&lt;BR /&gt;  $ show log sys$scratch&lt;BR /&gt;  $ write sys$output f$env("procedure")&lt;BR /&gt;Run command:&lt;BR /&gt;$ run /input=tmp.COM /out=tmp.log sys$system:loginout&lt;BR /&gt;%RUN-S-PROC_ID, identification of created process is 0008A863&lt;BR /&gt;$ type tmp.log&lt;BR /&gt;$ set nover&lt;BR /&gt;   "SYS$LOGIN" = "USER$DISK:[EDTTSZ]" (LNM$JOB_81975300)&lt;BR /&gt;   "SYS$SCRATCH" = "USER$DISK:[EDTTSZ]" (LNM$JOB_81975300)&lt;BR /&gt;TMP.COM&lt;BR /&gt;&lt;BR /&gt;Note that ANAL /SYS (sho proc /id=/chan)&lt;BR /&gt;displays full filespec input file.&lt;BR /&gt;Other tests show that f$env("PROCEDURE") just takes the value of /INPUT for despatched processes.     &lt;BR /&gt;&lt;BR /&gt; &lt;BR /&gt;</description>
      <pubDate>Mon, 07 Apr 2008 12:21:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101830#M43646</guid>
      <dc:creator>Teofil Smolowicz</dc:creator>
      <dc:date>2008-04-07T12:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: F$ENV("PROCEDURE") in detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101831#M43647</link>
      <description>... detached processes , not "despatched processes" should be, of course / t.</description>
      <pubDate>Mon, 07 Apr 2008 12:27:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101831#M43647</guid>
      <dc:creator>Teofil Smolowicz</dc:creator>
      <dc:date>2008-04-07T12:27:00Z</dc:date>
    </item>
    <item>
      <title>Re: F$ENV("PROCEDURE") in detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101832#M43648</link>
      <description>Teofil,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;Other tests show that f$env("PROCEDURE") just takes the value of /INPUT for despatched processes.&lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;&lt;BR /&gt;... which is exactly what you ask of it!&lt;BR /&gt;&lt;BR /&gt;Try this TMP.COM&lt;BR /&gt;&lt;BR /&gt;$! TMP.COM&lt;BR /&gt;$ @&lt;SOME other="" dir=""&gt;:&lt;COMFILE with="" run="" command.=""&gt;&lt;/COMFILE&gt;&lt;BR /&gt;You will see that NOW you get NOT TMP.COM, but the @-ed COM file. This is exactly what f$ENVIR("PROCEDURE") is documented to do: return the currently executing command procedure.&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe&lt;/SOME&gt;</description>
      <pubDate>Mon, 07 Apr 2008 12:30:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101832#M43648</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2008-04-07T12:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: F$ENV("PROCEDURE") in detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101833#M43649</link>
      <description>The help says: (help lex f$env atr)&lt;BR /&gt;"File specification of the current command&lt;BR /&gt;procedure."&lt;BR /&gt;It is what I expected: file specification.&lt;BR /&gt;Interactive does it, batch does it. Why not detached?&lt;BR /&gt;In the future I'll use &lt;BR /&gt;f$sear(f$env("procedure"))&lt;BR /&gt;instead for only f$env("procedure")&lt;BR /&gt;&lt;BR /&gt;Thank you for your answers.&lt;BR /&gt;Regards --- Teofil</description>
      <pubDate>Mon, 07 Apr 2008 12:50:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101833#M43649</guid>
      <dc:creator>Teofil Smolowicz</dc:creator>
      <dc:date>2008-04-07T12:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: F$ENV("PROCEDURE") in detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101834#M43650</link>
      <description>You are right : it's when you run loginout with /detached that you don't get sys$login.&lt;BR /&gt;&lt;BR /&gt;But it's still solved when you specify the full path name.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Mon, 07 Apr 2008 13:01:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101834#M43650</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-04-07T13:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: F$ENV("PROCEDURE") in detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101835#M43651</link>
      <description>It seems that if you do @, the correct thing is displayed. &lt;BR /&gt;&lt;BR /&gt;But in detached, it displays exactly what you passed as input file name.&lt;BR /&gt;&lt;BR /&gt;E.g. @xxxxx:tmp will show xxxxx:tmp (not xxxxx:tmp.com !).&lt;BR /&gt;&lt;BR /&gt;Wim&lt;BR /&gt;</description>
      <pubDate>Mon, 07 Apr 2008 13:08:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101835#M43651</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-04-07T13:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: F$ENV("PROCEDURE") in detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101836#M43652</link>
      <description>In the future I'll use &lt;BR /&gt;f$sear(f$env("procedure"))&lt;BR /&gt;instead for only f$env("procedure")&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Be sure that your default dir hasn't changed.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Mon, 07 Apr 2008 13:13:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101836#M43652</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-04-07T13:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: F$ENV("PROCEDURE") in detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101837#M43653</link>
      <description>You've used the magic word "correct".&lt;BR /&gt;T.</description>
      <pubDate>Mon, 07 Apr 2008 13:16:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101837#M43653</guid>
      <dc:creator>Teofil Smolowicz</dc:creator>
      <dc:date>2008-04-07T13:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: F$ENV("PROCEDURE") in detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101838#M43654</link>
      <description>The discussion gave me an idea how to solve the issue.</description>
      <pubDate>Mon, 07 Apr 2008 13:32:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101838#M43654</guid>
      <dc:creator>Teofil Smolowicz</dc:creator>
      <dc:date>2008-04-07T13:32:17Z</dc:date>
    </item>
    <item>
      <title>Re: F$ENV("PROCEDURE") in detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101839#M43655</link>
      <description>&lt;A href="http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1138609" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1138609&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;See attachment to replay dated Jun 22, 2007 17:00:12 GMT which has PPF.MAR (saved as .txt)&lt;BR /&gt;&lt;BR /&gt;This will allow you to determine the filename associated with process permanent files, like sys$output, syst$input, or files openned with DCL.&lt;BR /&gt;&lt;BR /&gt;I was surprised by the behavior you documented, but I was able to reproduce your results.&lt;BR /&gt;&lt;BR /&gt;For more interesting results try the following input file:&lt;BR /&gt;&lt;BR /&gt;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;BR /&gt;$ show log/proc&lt;BR /&gt;$ show log/job&lt;BR /&gt;$ show default&lt;BR /&gt;$ write sys$output f$environment("procedure")&lt;BR /&gt;$ write sys$output f$search(f$environment("procedure"))&lt;BR /&gt;$ ! following will need to removed or modified to see the effects of PPF&lt;BR /&gt;$ mcr utility:ppf sys$input&lt;BR /&gt;$ show sym /loc %%%_file_name&lt;BR /&gt;$ mcr utility:ppf sys$output&lt;BR /&gt;$ show sym /loc %%%_file_name&lt;BR /&gt;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&lt;BR /&gt;&lt;BR /&gt;Here are my findings:&lt;BR /&gt;&lt;BR /&gt;default directory of the deteched process is set to the current default directory of process doing the run (this is why f$search works)&lt;BR /&gt;If your default directory is different than the directory that input command procedure is in, the specified name for the input file must use only names that are available after your login.com runs.  Otherwise the input file will not be able to be found.&lt;BR /&gt;&lt;BR /&gt;For example the following will not work:&lt;BR /&gt;&lt;BR /&gt;$! assume input file in in your sys$login directory, and you current default directory is set to a subdirectory of your login directory e.g. [.itrc]&lt;BR /&gt;$ define inp sys$login:&lt;BR /&gt;$ run /input=inp:tmp.com /out=tmp.log sys$system:login.com&lt;BR /&gt;&lt;BR /&gt;This will be what is in tmp.log&lt;BR /&gt;&lt;BR /&gt;Error opening primary input file SYS$INPUT&lt;BR /&gt;Error in device name or inappropriate device type for operation&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Wim's suggestion of f$search(f$environment("procedure")) seems to work any time that the input file can be found, at least in the limited testing I did.  I can think of some cases where it is possible that it would not work correctly, where PPF sys$input would, but those would be race conditions where a new version of the tmp.com file was created between the run and the execution (I didn't reproduce this error case, although I see no reason it would not be a possibility, especially if the system was busy, and if run /prio=0 was specified.)&lt;BR /&gt;&lt;BR /&gt;The downside of PPF:  Not standard part of VMS.  Works only for the file specified by /input.  i.e. if tmp.com did an @abc, and in abc, and in abc.com there was an f$environment(procedure), &lt;BR /&gt;&lt;BR /&gt;other threads with info about PPF.MAR&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1139459" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1139459&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1198047" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1198047&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I am slso attaching a log of some of the testing I did.&lt;BR /&gt;&lt;BR /&gt;Jon</description>
      <pubDate>Mon, 07 Apr 2008 15:04:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101839#M43655</guid>
      <dc:creator>Jon Pinkley</dc:creator>
      <dc:date>2008-04-07T15:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: F$ENV("PROCEDURE") in detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101840#M43656</link>
      <description>Why not use &lt;BR /&gt;&lt;BR /&gt;/input='f$parse("tmp.com",,,"NO_CONCEAL")'&lt;BR /&gt;&lt;BR /&gt;?  &lt;BR /&gt;&lt;BR /&gt;Properly done this will guarantee that the complete file spec will be passed to the detached process.&lt;BR /&gt;&lt;BR /&gt;Robert</description>
      <pubDate>Mon, 07 Apr 2008 17:26:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101840#M43656</guid>
      <dc:creator>Robert_Boyd</dc:creator>
      <dc:date>2008-04-07T17:26:47Z</dc:date>
    </item>
    <item>
      <title>Re: F$ENV("PROCEDURE") in detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101841#M43657</link>
      <description>It wasn't my suggestion Jon. He came up with it himself.&lt;BR /&gt;&lt;BR /&gt;I use the solution f$parse of Robert.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Tue, 08 Apr 2008 06:11:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101841#M43657</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-04-08T06:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: F$ENV("PROCEDURE") in detached process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101842#M43658</link>
      <description>Robert,&lt;BR /&gt;Your f$parse call does not work! One "," is missing. ;-) Otherwise, an idea is good.&lt;BR /&gt;&lt;BR /&gt;Thanks, all of you guys, for your contribution.&lt;BR /&gt;Teofil</description>
      <pubDate>Tue, 08 Apr 2008 07:52:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/f-env-quot-procedure-quot-in-detached-process/m-p/5101842#M43658</guid>
      <dc:creator>Teofil Smolowicz</dc:creator>
      <dc:date>2008-04-08T07:52:33Z</dc:date>
    </item>
  </channel>
</rss>

