<?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: background process in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114530#M38957</link>
    <description>&lt;BR /&gt;&amp;gt;Another way that works quite well:&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt;$ SUBMIT &lt;WHATEVER you="" like=""&gt;&lt;BR /&gt;&amp;gt;$ SYNCHRONISE '$entry&lt;BR /&gt;&lt;BR /&gt;Syntax error:&lt;BR /&gt;&lt;BR /&gt;$ submit/hold login.com&lt;BR /&gt;Job LOGIN (queue SYS$BATCH, entry 621) holding&lt;BR /&gt;$ synchronize '$entry'&lt;BR /&gt;%JBC-E-NOSUCHJOB, no such job&lt;BR /&gt;&lt;BR /&gt;The parameter for SYNCHRONIZE is the job NAME. To use the entry number (much better, since the job name is not guaranteed unique), use /ENTRY&lt;BR /&gt;&lt;BR /&gt;$ SYNCHRONIZE/ENTRY='$ENTRY'&lt;BR /&gt;&lt;BR /&gt;SYNCHRONIZE is a very useful command, and frequently overlooked.&lt;BR /&gt; &lt;BR /&gt;A few other useful things to know, the $STATUS after a $ SYNC command is the completion status of the job (except, of course for the errors like JBC-E-NOSUCHENT)&lt;BR /&gt;&lt;BR /&gt;You can $SYNC against a RETAINED job. The $SYNC will return immediately, with $STATUS of that job.&lt;BR /&gt;&lt;BR /&gt;So, if you're not going to $SYNC immediately it's safer to do it like this:&lt;BR /&gt;&lt;BR /&gt;$ SUBMIT/RETAIN=ALWAYS &lt;WHATEVER&gt;&lt;BR /&gt;$ myentry=$STATUS&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;$ SYNCHRONIZE/ENTRY='myentry'&lt;BR /&gt;$ mystat=$STATUS&lt;BR /&gt;$ DELETE/ENTRY='myentry'&lt;/WHATEVER&gt;&lt;/WHATEVER&gt;</description>
    <pubDate>Tue, 11 Dec 2007 21:31:32 GMT</pubDate>
    <dc:creator>John Gillings</dc:creator>
    <dc:date>2007-12-11T21:31:32Z</dc:date>
    <item>
      <title>background process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114525#M38952</link>
      <description>the script should not exit until all the background process are complete&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;could you please provide the solution</description>
      <pubDate>Mon, 10 Dec 2007 21:52:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114525#M38952</guid>
      <dc:creator>gurram</dc:creator>
      <dc:date>2007-12-10T21:52:35Z</dc:date>
    </item>
    <item>
      <title>Re: background process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114526#M38953</link>
      <description>Which operating system and which version?  The OpenVMS operating system (the subject of this HP ITRC forum) offers subprocesses and detached processes, and batch processes, mechanisms which are analogous to Unix-style detached processes -- but are not called that.  &lt;BR /&gt;&lt;BR /&gt;OpenVMS also offers DCL command procedures, which are analogous to what Unix calls scripts -- but are not called that.&lt;BR /&gt;&lt;BR /&gt;Assuming there are just some differences in the terminology here and that this question is about OpenVMS...&lt;BR /&gt;&lt;BR /&gt;The two ways are to poll for the processes using f$getjpi and DCL loops and such, and commands such as SYNCHRONIZE, or to implement a mechanism using the distributed lock manager (DLM) to coordinate the various processes.  Or batch.&lt;BR /&gt;&lt;BR /&gt;It's also quite common to see scheduling packages used to control these sorts of activities.  There are several of these packages around, both free and commercial.&lt;BR /&gt;&lt;BR /&gt;And batch jobs and batch queues can also be used to control execution.  Commands here include f$getqui and such.&lt;BR /&gt;&lt;BR /&gt;Assuming this is OpenVMS, which OpenVMS platform and which OpenVMS version is in use here, and do you have access to make modifications to the background processes and the procedure.  Some background on your particular situation would be helpful, in other words.&lt;BR /&gt;&lt;BR /&gt;If this is a Unix shell of some sort, see if whichever shell here you're working with has the jobs command.  (This tends to be tied in with the fg and bg commands and related.)  And FWIW, the book _UNIX for the Impatient_ is a good resource for these sorts of shell situations.  (I have the first edition, but there's a second edition available now.)  There is a Unix forum (HP-UX) around here, too.&lt;BR /&gt;&lt;BR /&gt;Stephen Hoffman&lt;BR /&gt;HoffmanLabs LLC</description>
      <pubDate>Mon, 10 Dec 2007 22:14:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114526#M38953</guid>
      <dc:creator>Hoff</dc:creator>
      <dc:date>2007-12-10T22:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: background process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114527#M38954</link>
      <description>&lt;!--!*#--&gt;You mean something like this ?&lt;BR /&gt;&amp;gt;ty wim.txt&lt;BR /&gt;$ spa/nowait wait 00:00:05&lt;BR /&gt;$ spa/nowait wait 00:00:08&lt;BR /&gt;$redo:&lt;BR /&gt;$ pc=f$getjpi(0,"prccnt")&lt;BR /&gt;$ if pc .gt. 0&lt;BR /&gt;$ then&lt;BR /&gt;$    write sys$output "Waiting for ''pc' processes to complete&lt;BR /&gt;$    wait 00:00:01&lt;BR /&gt;$    goto redo&lt;BR /&gt;$ endif&lt;BR /&gt;&lt;BR /&gt;&amp;gt;@wim.txt&lt;BR /&gt;%DCL-S-SPAWNED, process SYSMGR_WVW_2 spawned&lt;BR /&gt;%DCL-S-SPAWNED, process SYSMGR_WVW_3 spawned&lt;BR /&gt;Waiting for 2 processes to complete&lt;BR /&gt;Waiting for 2 processes to complete&lt;BR /&gt;Waiting for 2 processes to complete&lt;BR /&gt;Waiting for 2 processes to complete&lt;BR /&gt;Waiting for 2 processes to complete&lt;BR /&gt;Waiting for 1 processes to complete&lt;BR /&gt;Waiting for 1 processes to complete&lt;BR /&gt;Waiting for 1 processes to complete&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Tue, 11 Dec 2007 12:37:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114527#M38954</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2007-12-11T12:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: background process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114528#M38955</link>
      <description>Another approach that even works for clusters - but requires some considerable privileges - is to pre-define some name for a cluster-wide logical that changes from "RUNNING" to "DONE" and then have the waiting process check those logical names every so often.&lt;BR /&gt;&lt;BR /&gt;Another approach that works for clusters if you have services set up right is to capture the PID of the process on which you are waiting and perform F$GETJPI calls on it to get a status.  Trap errors when you do.  Like, ON ERROR THEN CONTINUE.  Then look for it to return something.  As long as F$GETJPI can see that process, you can look up something (anything) about the process.  When it is no longer running, you will get back an empty string for the process in question.  I might use "STATE" as the JPI attribute I query if I were doing it.  Again, just write a little loop to test the F$GETJPI probe and exit the loop when your process - or processes - are done.&lt;BR /&gt;</description>
      <pubDate>Tue, 11 Dec 2007 16:26:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114528#M38955</guid>
      <dc:creator>Richard W Hunt</dc:creator>
      <dc:date>2007-12-11T16:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: background process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114529#M38956</link>
      <description>gurram,&lt;BR /&gt;&lt;BR /&gt;some good suggestions so far,&lt;BR /&gt;&lt;BR /&gt;Another way that works quite well:&lt;BR /&gt;&lt;BR /&gt;$ SUBMIT &lt;WHATEVER you="" like=""&gt;&lt;BR /&gt;$ SYNCHRONISE  '$entry&lt;BR /&gt;&lt;BR /&gt;If you want to do something else in the meantime:&lt;BR /&gt;&lt;BR /&gt;$ SUBMIT &lt;WHATEVER you="" like=""&gt;&lt;BR /&gt;$ somename =  $entry&lt;BR /&gt;&lt;BR /&gt;...  now do whatever.&lt;BR /&gt;&lt;BR /&gt;$ SYNCHRONISE 'somename&lt;BR /&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;BR /&gt;&lt;BR /&gt;&lt;/WHATEVER&gt;&lt;/WHATEVER&gt;</description>
      <pubDate>Tue, 11 Dec 2007 17:25:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114529#M38956</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2007-12-11T17:25:52Z</dc:date>
    </item>
    <item>
      <title>Re: background process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114530#M38957</link>
      <description>&lt;BR /&gt;&amp;gt;Another way that works quite well:&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt;$ SUBMIT &lt;WHATEVER you="" like=""&gt;&lt;BR /&gt;&amp;gt;$ SYNCHRONISE '$entry&lt;BR /&gt;&lt;BR /&gt;Syntax error:&lt;BR /&gt;&lt;BR /&gt;$ submit/hold login.com&lt;BR /&gt;Job LOGIN (queue SYS$BATCH, entry 621) holding&lt;BR /&gt;$ synchronize '$entry'&lt;BR /&gt;%JBC-E-NOSUCHJOB, no such job&lt;BR /&gt;&lt;BR /&gt;The parameter for SYNCHRONIZE is the job NAME. To use the entry number (much better, since the job name is not guaranteed unique), use /ENTRY&lt;BR /&gt;&lt;BR /&gt;$ SYNCHRONIZE/ENTRY='$ENTRY'&lt;BR /&gt;&lt;BR /&gt;SYNCHRONIZE is a very useful command, and frequently overlooked.&lt;BR /&gt; &lt;BR /&gt;A few other useful things to know, the $STATUS after a $ SYNC command is the completion status of the job (except, of course for the errors like JBC-E-NOSUCHENT)&lt;BR /&gt;&lt;BR /&gt;You can $SYNC against a RETAINED job. The $SYNC will return immediately, with $STATUS of that job.&lt;BR /&gt;&lt;BR /&gt;So, if you're not going to $SYNC immediately it's safer to do it like this:&lt;BR /&gt;&lt;BR /&gt;$ SUBMIT/RETAIN=ALWAYS &lt;WHATEVER&gt;&lt;BR /&gt;$ myentry=$STATUS&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;$ SYNCHRONIZE/ENTRY='myentry'&lt;BR /&gt;$ mystat=$STATUS&lt;BR /&gt;$ DELETE/ENTRY='myentry'&lt;/WHATEVER&gt;&lt;/WHATEVER&gt;</description>
      <pubDate>Tue, 11 Dec 2007 21:31:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114530#M38957</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2007-12-11T21:31:32Z</dc:date>
    </item>
    <item>
      <title>Re: background process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114531#M38958</link>
      <description>@John:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;&amp;gt;Another way that works quite well:&lt;BR /&gt;&amp;gt;&lt;BR /&gt;&amp;gt;$ SUBMIT &lt;WHATEVER you="" like=""&gt;&lt;BR /&gt;&amp;gt;$ SYNCHRONISE '$entry&lt;BR /&gt;&lt;BR /&gt;Syntax error:&lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;&lt;BR /&gt;Well, mostly you are right.&lt;BR /&gt;If SYNCHRONISing on the entry number, I should have used the /ENTRY=.. qualifier.&lt;BR /&gt;(that's what comes from answering from bio memory).&lt;BR /&gt;&lt;BR /&gt;But, it is _NOT_ a syntax error.&lt;BR /&gt;&lt;BR /&gt;And I _COULD_ even make it work, by  SUBMIT/HOLD  xxx&lt;BR /&gt;$ SET ENTRY '$entry' /NAME='$entry'&lt;BR /&gt;$ SET ENTRY '$entry'/RELEASE&lt;BR /&gt;&lt;BR /&gt;Admittedly, crafted to make it work, but, _NOT_ a syntax error.&lt;BR /&gt;&lt;BR /&gt;fwiw&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;BR /&gt;&lt;/WHATEVER&gt;</description>
      <pubDate>Wed, 12 Dec 2007 15:33:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114531#M38958</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2007-12-12T15:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: background process</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114532#M38959</link>
      <description>Addendum:&lt;BR /&gt;&lt;BR /&gt;Probably that should have been quoted:&lt;BR /&gt;... /NAME"''$entry'"&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on me.&lt;BR /&gt;&lt;BR /&gt;jpe</description>
      <pubDate>Wed, 12 Dec 2007 15:35:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/background-process/m-p/4114532#M38959</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2007-12-12T15:35:39Z</dc:date>
    </item>
  </channel>
</rss>

