<?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: file renaming and Entry input in Operating System - OpenVMS</title>
    <link>https://community.hpe.com/t5/operating-system-openvms/file-renaming-and-entry-input/m-p/3603958#M32555</link>
    <description>F$Search uses a 2nd parameter (Context), so that you can nest F$SEARCHes, e.g. an outer loop uses F$SEARCH(file,1212) and an inner loop f$SEARCH(file2,1313).&lt;BR /&gt;&lt;BR /&gt;I'm not sure, if I understand your 2nd problem, but you can wait for the completion of a batchjob with SYNCHRONIZE. The SUBMIT command returns the entrynumber of a batchjob in the DCL symbol $ENTRY.&lt;BR /&gt;&lt;BR /&gt;regards Kalle</description>
    <pubDate>Mon, 15 Aug 2005 12:45:53 GMT</pubDate>
    <dc:creator>Karl Rohwedder</dc:creator>
    <dc:date>2005-08-15T12:45:53Z</dc:date>
    <item>
      <title>file renaming and Entry input</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/file-renaming-and-entry-input/m-p/3603956#M32553</link>
      <description>Hi,&lt;BR /&gt; I need to automate certain mechanical tasks. However, I have two separate problems right now. &lt;BR /&gt;&lt;BR /&gt;My dir structure fixed for all projects &lt;BR /&gt;projDir1 - models.dir&lt;BR /&gt;         - com.dir &lt;BR /&gt;         - data.dir&lt;BR /&gt;&lt;BR /&gt;Problem 1&lt;BR /&gt;&lt;BR /&gt;Now I have setup a script &lt;BR /&gt;&lt;BR /&gt;which moves *.EXT files to models.dir &lt;BR /&gt;now I wish to rename the latest version file(*.EXT) in models.dir  to &lt;BR /&gt;&lt;BR /&gt;*_GFILT.EXT&lt;BR /&gt;like the following&lt;BR /&gt;$RENAME [.models]*.ext [.models]*_GFILT.EXT &lt;BR /&gt;&lt;BR /&gt;So I need to add/insert the stringg "_GFILT"&lt;BR /&gt;&lt;BR /&gt;Currently I do &lt;BR /&gt;NAME_EXT=F$Search("[.models]*.EXT")&lt;BR /&gt;NAME = NAME_EXT - "AIM;1"&lt;BR /&gt;NAME_NEW = NAME +"_GFILT.AIM"&lt;BR /&gt;&lt;BR /&gt;RENAME *.AIM 'NAME_NEW&lt;BR /&gt;&lt;BR /&gt;However, F$search understandably keeps track of the older path so&lt;BR /&gt;when i make a new projDir2&lt;BR /&gt;&lt;BR /&gt;projDir2 - models.dir&lt;BR /&gt;         - com.dir &lt;BR /&gt;         - data.dir&lt;BR /&gt;&lt;BR /&gt;it still searches in "projDir1" instead of "projDir2"&lt;BR /&gt;&lt;BR /&gt;If you are aware of better way to insert "GFILT" please let me know or to clear pointer of F$Search&lt;BR /&gt;&lt;BR /&gt;Problem 2&lt;BR /&gt;&lt;BR /&gt;In the above projects I start a que_base which on it's completion generates data_que&lt;BR /&gt;&lt;BR /&gt;now I need to wait for que_base to end in order to start the next type of que to process data_que&lt;BR /&gt;&lt;BR /&gt;How can I automate this to get final_data&lt;BR /&gt;&lt;BR /&gt;so projDir1_data -&amp;gt; start que_base -&amp;gt; data_que-&amp;gt;start que_next-&amp;gt;final_data&lt;BR /&gt;&lt;BR /&gt;if there is simple way please let me know&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 15 Aug 2005 09:57:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/file-renaming-and-entry-input/m-p/3603956#M32553</guid>
      <dc:creator>nipun_2</dc:creator>
      <dc:date>2005-08-15T09:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: file renaming and Entry input</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/file-renaming-and-entry-input/m-p/3603957#M32554</link>
      <description>You can easily invalidate the F$SEARCH() context. In the history I used&lt;BR /&gt;$ S = F$SEARCH("@")&lt;BR /&gt;&lt;BR /&gt;but Jan had a better idea:&lt;BR /&gt;$ S = F$SEARCH ("INVALIDATE_SEARCH_CONTEXT")&lt;BR /&gt;&lt;BR /&gt;It is highly unlikely that you have a file by that name, right?&lt;BR /&gt;&lt;BR /&gt;For problem 2:&lt;BR /&gt;it sounds like you are working with batch jobs, but I am not absolutely sure - would be nice if you can explain a bit more details.&lt;BR /&gt;&lt;BR /&gt;If my guess is right, can you SUBMIT them for batch processing in a batch queue with /JOB_LIMIT=1. ?</description>
      <pubDate>Mon, 15 Aug 2005 11:30:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/file-renaming-and-entry-input/m-p/3603957#M32554</guid>
      <dc:creator>Uwe Zessin</dc:creator>
      <dc:date>2005-08-15T11:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: file renaming and Entry input</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/file-renaming-and-entry-input/m-p/3603958#M32555</link>
      <description>F$Search uses a 2nd parameter (Context), so that you can nest F$SEARCHes, e.g. an outer loop uses F$SEARCH(file,1212) and an inner loop f$SEARCH(file2,1313).&lt;BR /&gt;&lt;BR /&gt;I'm not sure, if I understand your 2nd problem, but you can wait for the completion of a batchjob with SYNCHRONIZE. The SUBMIT command returns the entrynumber of a batchjob in the DCL symbol $ENTRY.&lt;BR /&gt;&lt;BR /&gt;regards Kalle</description>
      <pubDate>Mon, 15 Aug 2005 12:45:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/file-renaming-and-entry-input/m-p/3603958#M32555</guid>
      <dc:creator>Karl Rohwedder</dc:creator>
      <dc:date>2005-08-15T12:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: file renaming and Entry input</title>
      <link>https://community.hpe.com/t5/operating-system-openvms/file-renaming-and-entry-input/m-p/3603959#M32556</link>
      <description>The way that you have problem 1 stated shows that you are useing the directory as "[.models]" which seems to indicate that you are relaying on your current default directory to be correct.  Try setting your default directory to [projdir2] before you start the next f$search for "[.models]".  Also using the f$search context is always a good idea so that you don't get searches mixed up between each other.&lt;BR /&gt;&lt;BR /&gt;For problem2 I agree that we need more specific information on the problem. If you are using the SUBMIT command then try sumbitting it with a /NAME=job-name and then use the SYNCHRONIZE command in DCL to tell if it is finished.  If you are submitting multiple procedures to the batch job and you want to watch the queue until all the jobs are finished then you need to use a gosub as follows:&lt;BR /&gt;&lt;BR /&gt;$CHECK_OPTIMIZE_JOB:&lt;BR /&gt;$ wait 00:10:00.00&lt;BR /&gt;$ temp = f$getqui("")&lt;BR /&gt;$ optimize_done = "Y"&lt;BR /&gt;$ write sys$output "Checking SYS$BATCH for OPTIMIZE_FILE at ''f$time()'"&lt;BR /&gt;$QLOOP:&lt;BR /&gt;$ qname = f$getqui("DISPLAY_QUEUE","QUEUE_NAME","SYS$BATCH*")&lt;BR /&gt;$! if qname .eqs. "" then goto exit_check_optimize_job&lt;BR /&gt;$JLOOP:&lt;BR /&gt;$ jname = f$getqui("DISPLAY_JOB","JOB_NAME",,"ALL_JOBS")&lt;BR /&gt;$ if jname .eqs. "" then goto end_wait_loop&lt;BR /&gt;$! write sys$output jname&lt;BR /&gt;$ if jname .eqs. "OPTIMIZE_FILE"&lt;BR /&gt;$  then&lt;BR /&gt;$   optimize_done = "N"&lt;BR /&gt;$   write sys$output "Found an OPTIMIZE_FILE job in SYS$BATCH"&lt;BR /&gt;$   goto end_wait_loop&lt;BR /&gt;$ endif&lt;BR /&gt;$ goto jloop&lt;BR /&gt;$!&lt;BR /&gt;$END_WAIT_LOOP:&lt;BR /&gt;$ if optimize_done .eqs. "Y" then goto exit_check_optimize_job&lt;BR /&gt;$ goto check_optimize_job&lt;BR /&gt;$!&lt;BR /&gt;$EXIT_CHECK_OPTIMIZE_JOB:&lt;BR /&gt;$ return&lt;BR /&gt;&lt;BR /&gt;This basically looks for a specific file name in the bqtch queue and if it finds one still in the queue it waits and looks again.  If there it doesn't find one in the queue then it will exit and your procedure can continue with the next batch of files to submit.&lt;BR /&gt;&lt;BR /&gt;Phil</description>
      <pubDate>Mon, 15 Aug 2005 13:28:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-openvms/file-renaming-and-entry-input/m-p/3603959#M32556</guid>
      <dc:creator>Phillip Thayer</dc:creator>
      <dc:date>2005-08-15T13:28:33Z</dc:date>
    </item>
  </channel>
</rss>

