<?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: Job with dependencies on current job in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103413#M25573</link>
    <description>F$GETQUI("DISPLAY_ENTRY","ENTRY_NUMBER","MY_JOB") &lt;BR /&gt;&lt;BR /&gt;Tried it and it doesn't return anything. With the entry number it does.&lt;BR /&gt;&lt;BR /&gt;John ?&lt;BR /&gt;&lt;BR /&gt;Wim</description>
    <pubDate>Wed, 16 Apr 2008 05:40:23 GMT</pubDate>
    <dc:creator>Wim Van den Wyngaert</dc:creator>
    <dc:date>2008-04-16T05:40:23Z</dc:date>
    <item>
      <title>Job with dependencies on current job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103404#M25564</link>
      <description>Hi folks,&lt;BR /&gt;&lt;BR /&gt;We currently don't have 3rd party tools on our site to do our job scheduling, thus we have to rely on scripting on most of our jobs.&lt;BR /&gt;&lt;BR /&gt;Currently, we need to implement a job that has dependencies on it. Previously, we submit each of the jobs in the job stream using the /after parameter. However, with this new job, the finish time of the predecessor jobs has been irregular, thus we need to create a script that will initially submit all the downstream jobs on hold (/hold), and have the current job release it after it reaches a certain stage on its execution.&lt;BR /&gt;&lt;BR /&gt;I have been studying the F$GETQUI lexical, but its a bit hard to understand this particular lexical. &lt;BR /&gt;&lt;BR /&gt;As an example, I have jobs A, B and C that runs on FOOBAR$BATCH. I'll submit all 3 jobs at once, but only job A will process first, and jobs B and C will be on hold. After a certain stage in job A, I'll need to release job B, which will release job C later once it finishes, while job A is still doing some other stuff.&lt;BR /&gt;&lt;BR /&gt;I have this script that I have modified slightly from the F$GETQUI sample materials, but I don't understand how I can specify that I only want to check FOOBAR$BATCH, and only job B (from job A's context) will be released:&lt;BR /&gt;&lt;BR /&gt;$ TEMP = F$GETQUI("")&lt;BR /&gt;$ QLOOP:&lt;BR /&gt;$ QNAME = F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","*")&lt;BR /&gt;$ IF QNAME .EQS. "" THEN EXIT&lt;BR /&gt;$ JLOOP:&lt;BR /&gt;$ IF NOACCESS .EQS. "" THEN GOTO QLOOP&lt;BR /&gt;$ JNAME = F$GETQUI("DISPLAY_JOB","JOB_NAME",,"FREEZE_CONTEXT")&lt;BR /&gt;$ IF JNAME .EQS. "MY_JOB"&lt;BR /&gt;$ THEN&lt;BR /&gt;$    JNUM = F$GETQUI("DISPLAY_JOB","ENTRY_NUMBER",,"FREEZE_CONTEXT")&lt;BR /&gt;$    JSTAT = F$GETQUI("DISPLAY_JOB","JOB_HOLDING",,"FREEZE_CONTEXT")&lt;BR /&gt;$    IF JSTAT THEN SET ENTRY 'JNUM'/RELEASE&lt;BR /&gt;$ ENDIF&lt;BR /&gt;$ GOTO JLOOP&lt;BR /&gt;&lt;BR /&gt;Anyone can help me on this, please? Thanks!&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Apr 2008 05:17:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103404#M25564</guid>
      <dc:creator>roose</dc:creator>
      <dc:date>2008-04-15T05:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Job with dependencies on current job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103405#M25565</link>
      <description>QNAME = F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","*")&lt;BR /&gt;&lt;BR /&gt;must become&lt;BR /&gt;QNAME = F$GETQUI("DISPLAY_QUEUE","QUEUE_NAME","FOOBAR$BATCH","WILDCARD")&lt;BR /&gt;&lt;BR /&gt;Wim&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Apr 2008 05:46:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103405#M25565</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-04-15T05:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: Job with dependencies on current job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103406#M25566</link>
      <description>Hello&lt;BR /&gt;&lt;BR /&gt;Your want to synchronize and communicate between Vms processes.&lt;BR /&gt;&lt;BR /&gt;You have many possibilities&lt;BR /&gt;&lt;BR /&gt;- the Vms command synchronize job-name or synchronize/entry=&lt;BR /&gt;&lt;BR /&gt;- use a lock&lt;BR /&gt;&lt;BR /&gt;- use a logical name&lt;BR /&gt;&lt;BR /&gt;- use a file in which a process writes and others read&lt;BR /&gt;&lt;BR /&gt;- use a mailbox&lt;BR /&gt;&lt;BR /&gt;- use a global section&lt;BR /&gt;&lt;BR /&gt;- use a local event flag&lt;BR /&gt;&lt;BR /&gt;Have a look at the doc &lt;BR /&gt;Process Communication&lt;BR /&gt;at&lt;BR /&gt;&lt;A href="http://www.itec.suny.edu/scsys/vms/vmsdoc/72final/5841/5841pro_002.html#chap_process_communication" target="_blank"&gt;http://www.itec.suny.edu/scsys/vms/vmsdoc/72final/5841/5841pro_002.html#chap_process_communication&lt;/A&gt;</description>
      <pubDate>Tue, 15 Apr 2008 05:55:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103406#M25566</guid>
      <dc:creator>labadie_1</dc:creator>
      <dc:date>2008-04-15T05:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Job with dependencies on current job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103407#M25567</link>
      <description>I'm missing something "all_jobs" in your script.&lt;BR /&gt;&lt;BR /&gt;You can replace the word all_jobs by "holding_jobs" and you will only get the jobs in hold. Then the jstat must no longer be tested.&lt;BR /&gt;&lt;BR /&gt;Wim (agree that this is a hard-to-get lexical)</description>
      <pubDate>Tue, 15 Apr 2008 06:04:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103407#M25567</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-04-15T06:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Job with dependencies on current job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103408#M25568</link>
      <description>Roose,&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt; I'll submit all 3 jobs at once, but only job A will process first, and jobs B and C will be on hold.&lt;BR /&gt;After a certain stage in job A,&lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;As Gerard Labadie wrote, there are many ways.&lt;BR /&gt;The way _I_ would do that, is to make a simple 4th job:&lt;BR /&gt;&lt;BR /&gt;$ SUBMIT B /Que=.../hold&lt;BR /&gt;$ entry_B = $entry&lt;BR /&gt;$ submit C /que=.../hold/param=entry_b&lt;BR /&gt;$ submit A /que=.../param=entry_b&lt;BR /&gt;&lt;BR /&gt;Modify A.COM: "after a certain stage" add one line:&lt;BR /&gt;$ set entry p1/release&lt;BR /&gt;&lt;BR /&gt;Modify C.COM: Add as first line&lt;BR /&gt;$ SYNCHRONISE /entry='p1'&lt;BR /&gt;&lt;BR /&gt;Lookup HELP SYNCHRONISE and HELP SUBMIT QUALIFIERS for the details.&lt;BR /&gt;&lt;BR /&gt;hth&lt;BR /&gt;&lt;BR /&gt;Proost.&lt;BR /&gt;&lt;BR /&gt;Have one on em.&lt;BR /&gt;&lt;BR /&gt;jpe&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Apr 2008 06:15:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103408#M25568</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2008-04-15T06:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Job with dependencies on current job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103409#M25569</link>
      <description>For examples on how to use F$GETQUI See VTJ #11 &lt;BR /&gt;&lt;A href="http://h71000.www7.hp.com/openvms/journal/index.html#getqui" target="_blank"&gt;http://h71000.www7.hp.com/openvms/journal/index.html#getqui&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;and&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://dcl.openvms.org" target="_blank"&gt;http://dcl.openvms.org&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 15 Apr 2008 08:12:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103409#M25569</guid>
      <dc:creator>Ian Miller.</dc:creator>
      <dc:date>2008-04-15T08:12:01Z</dc:date>
    </item>
    <item>
      <title>Re: Job with dependencies on current job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103410#M25570</link>
      <description>Thanks for the help folks! I think I got the idea now of what I need to do :)</description>
      <pubDate>Tue, 15 Apr 2008 08:52:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103410#M25570</guid>
      <dc:creator>roose</dc:creator>
      <dc:date>2008-04-15T08:52:11Z</dc:date>
    </item>
    <item>
      <title>Re: Job with dependencies on current job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103411#M25571</link>
      <description>roose,&lt;BR /&gt;&lt;BR /&gt;  As others have suggested, SYNCHRONIZE is the way to go to serialise jobs. For some reason it seems to not be used much, which is a bit of a surprise because it's a very useful command, especially in conjunction with the symbol $ENTRY defined after a SUBMIT or PRINT command &lt;BR /&gt;&lt;BR /&gt;  Here are a few hints and tips on using SYNCHRONIZE.&lt;BR /&gt;&lt;BR /&gt;  SYNCH against a completed, retained job will return immediately, and set $STATUS to the completion status of the job. Consider these command sequences:&lt;BR /&gt;&lt;BR /&gt;$ SUBMIT/RETAIN=ALWAYS A&lt;BR /&gt;$ entry_A=$ENTRY&lt;BR /&gt;&lt;BR /&gt;sometime later, possibly in another job:&lt;BR /&gt;&lt;BR /&gt;$ SYNCHRONIZE='entry_A'&lt;BR /&gt;$ status_A=$STATUS&lt;BR /&gt;$ DELETE/ENTRY='entry_A'&lt;BR /&gt;&lt;BR /&gt;SYNCHRONIZE with a non-existent entry will result in JBC-E-NOSUCHENT. To check if a particular entry exists, use&lt;BR /&gt;&lt;BR /&gt;F$GETQUI("DISPLAY_ENTRY","ENTRY_NUMBER",entry)&lt;BR /&gt;&lt;BR /&gt;If the entry does not exist, F$GETQUI will return a blank (and no error). If you're cautious, test:&lt;BR /&gt;&lt;BR /&gt;F$GETQUI("DISPLAY_ENTRY","ENTRY_NUMBER",entry).EQS.entry&lt;BR /&gt;&lt;BR /&gt;to confirm that the entry really exists.&lt;BR /&gt;&lt;BR /&gt;Also note that if you know the name of your job, you don't need to do F$GETQUI loops across all queues. You can go direct to the matching entries:&lt;BR /&gt;&lt;BR /&gt;$ entry=F$GETQUI("DISPLAY_ENTRY","ENTRY_NUMBER","MY_JOB")&lt;BR /&gt;&lt;BR /&gt;will return the first found job with matching name. If there may be more than one, add "WILDCARD" to turn it into a loop. &lt;BR /&gt;&lt;BR /&gt;Try this:&lt;BR /&gt;&lt;BR /&gt;$ EntryLoop: e=F$GETQUI("DISPLAY_ENTRY","ENTRY_NUMBER",name,"WILDCARD")&lt;BR /&gt;$   IF e.NES.""&lt;BR /&gt;$   THEN&lt;BR /&gt;$     s=F$GETQUI("DISPLAY_ENTRY","JOB_STATUS",e,"FREEZE_CONTEXT")&lt;BR /&gt;$     GOSUB JobStatus's'&lt;BR /&gt;$     GOTO EntryLoop&lt;BR /&gt;$   ENDIF&lt;BR /&gt;$&lt;BR /&gt;$ JobStatus1: ! JOB_ABORTING&lt;BR /&gt;$ JobStatus2: ! JOB_EXECUTING&lt;BR /&gt;$ JobStatus8: ! JOB_INACCESSIBLE&lt;BR /&gt;$ JobStatus16: ! JOB_REFUSED&lt;BR /&gt;$ JobStatus32: ! JOB_REQUEUE&lt;BR /&gt;$ JobStatus64: ! JOB_RESTARTING &lt;BR /&gt;$ JobStatus128: ! JOB_RETAINED&lt;BR /&gt;$ JobStatus256: ! JOB_STARTING&lt;BR /&gt;$ JobStatus1024: ! JOB_SUSPENDED&lt;BR /&gt;$ JobStatus2048: ! JOB_PENDING&lt;BR /&gt;$ JobStatus4096: ! JOB_UNDEFINED&lt;BR /&gt;$ JobStatus8192: ! JOB_STALLED&lt;BR /&gt;$ JobStatus16384: ! JOB_INCOMPLETE&lt;BR /&gt;$ JobStatus32768: ! JOB_COMPLETING&lt;BR /&gt;$!  do nothing&lt;BR /&gt;$ RETURN&lt;BR /&gt;$&lt;BR /&gt;$ JobStatus4: ! JOB_HOLDING&lt;BR /&gt;$ JobStatus512: ! JOB_TIMED_RELEASE &lt;BR /&gt;$   SET ENTRY/RELEASE 'e'&lt;BR /&gt;$ RETURN&lt;BR /&gt;&lt;BR /&gt;FWIW, I recently confirmed with OpenVMS engineering that a job status will only ever have a single bit set, so the above DCL "CASE" statement will work correctly.&lt;BR /&gt;&lt;BR /&gt;Another curiosity is that SYNCHRONIZE will work against a PRINT job as well as batch job.&lt;BR /&gt;&lt;BR /&gt;As well as serialising jobs, you can use synchronize to parallelise. Break the job up into a number of tasks, which can be SUBMITted as independent jobs, possibly across a cluster. Use /RETAIN=ALWAYS, and accumulate a list of entry numbers. Once they're all submitted, sit in a loop SYNCHRONIZEing against the entries, and cleaning up the completed ones. You can also copy the log files to SYS$OUTPUT so they're all in one place.</description>
      <pubDate>Tue, 15 Apr 2008 22:09:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103411#M25571</guid>
      <dc:creator>John Gillings</dc:creator>
      <dc:date>2008-04-15T22:09:21Z</dc:date>
    </item>
    <item>
      <title>Re: Job with dependencies on current job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103412#M25572</link>
      <description>Everyone seems to forget :&lt;BR /&gt;After a certain stage in job A, I'll need to release job B.&lt;BR /&gt;&lt;BR /&gt;So the job is not finished yet and thus sync will not do the work.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Wed, 16 Apr 2008 05:37:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103412#M25572</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-04-16T05:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: Job with dependencies on current job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103413#M25573</link>
      <description>F$GETQUI("DISPLAY_ENTRY","ENTRY_NUMBER","MY_JOB") &lt;BR /&gt;&lt;BR /&gt;Tried it and it doesn't return anything. With the entry number it does.&lt;BR /&gt;&lt;BR /&gt;John ?&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Wed, 16 Apr 2008 05:40:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103413#M25573</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-04-16T05:40:23Z</dc:date>
    </item>
    <item>
      <title>Re: Job with dependencies on current job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103414#M25574</link>
      <description>Solved. It works when it's your job, t.i. the same username.&lt;BR /&gt;&lt;BR /&gt;Still puzzled that you may pass the job name as an entry number.&lt;BR /&gt;&lt;BR /&gt;Wim</description>
      <pubDate>Wed, 16 Apr 2008 07:07:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103414#M25574</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-04-16T07:07:33Z</dc:date>
    </item>
    <item>
      <title>Re: Job with dependencies on current job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103415#M25575</link>
      <description>@Wim:&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt;&amp;gt;&lt;BR /&gt;Everyone seems to forget :&lt;BR /&gt;After a certain stage in job A, I'll need to release job B.&lt;BR /&gt;&lt;BR /&gt;So the job is not finished yet and thus sync will not do the work.&lt;BR /&gt;&amp;lt;&amp;lt;&amp;lt;&lt;BR /&gt;&lt;BR /&gt;Eh?&lt;BR /&gt;Please re-read my code snippet. It SYNCHRONISEs on the to-be-completed job, but, as requested, "at a certain stage", it SET ENTRY=../RELEASE for the other one!&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;</description>
      <pubDate>Wed, 16 Apr 2008 07:09:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103415#M25575</guid>
      <dc:creator>Jan van den Ende</dc:creator>
      <dc:date>2008-04-16T07:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Job with dependencies on current job</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103416#M25576</link>
      <description>No longer puzzled : it's documented.&lt;BR /&gt;&lt;BR /&gt;The object-id argument specifies either the name or the number of an object (for example, a specific queue name, job name, or form number) about which F$GETQUI is to return information. &lt;BR /&gt;&lt;BR /&gt;@Jan : Sorry. Overread that. &lt;BR /&gt;&lt;BR /&gt;Wim (wishing for Google performance at HP forums)</description>
      <pubDate>Wed, 16 Apr 2008 07:45:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/job-with-dependencies-on-current-job/m-p/5103416#M25576</guid>
      <dc:creator>Wim Van den Wyngaert</dc:creator>
      <dc:date>2008-04-16T07:45:07Z</dc:date>
    </item>
  </channel>
</rss>

