That&#39;s a good trick!  Thanks!<br>Tyler<br><br><div class="gmail_quote">On Tue, Feb 2, 2010 at 7:36 AM, Richard Kreiss <span dir="ltr">&lt;<a href="mailto:rkreiss@verizon.net">rkreiss@verizon.net</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Tyler,<br>
<br>
My procedure for getting to an available record is simple.<br>
<br>
<br>
@once  ◄ If: &#39;******************************************************<br>
       Then: &#39;* get file name to import<br>
144  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -<br>
       ◄ If: rn = &quot;&quot;<br>
       Then: rn(8,.0)=&quot;1&quot;<br>
145  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -<br>
loop_rn◄ If:<br>
       Then: lookup -  r=rn   -npw<br>
146  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -<br>
       ◄ If:         locked(-)<br>
       Then:         rn=rn+&quot;1&quot;;GOTO loop_rn<br>
147  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -<br>
       ◄ If:<br>
       Then: END<br>
<br>
This process will walk through the file and get the first available non locked record.  Note that the file I use for this process contains 1 field and all records are always blank.  The only way a record in this file would be locked is when someone else is running a process that uses this file.<br>

<br>
I will use this file for report/clerk applications where clerk is used to get selection data based on the report being run.<br>
<br>
Since @once runs before and record is selected, you could run your processing from @once and not worry about locking a record.  I do this for some imports as all the is happening is data is being read in and then posted to a new file.<br>

<br>
<br>
Richard Kreiss<br>
GCC Consulting<br>
<a href="mailto:rkreiss@gccconsulting.net">rkreiss@gccconsulting.net</a><br>
<div class="im"><br>
<br>
<br>
<br>
&gt; -----Original Message-----<br>
&gt; From: filepro-list-bounces+rkreiss=<a href="http://verizon.net" target="_blank">verizon.net</a>@<a href="http://lists.celestial.com" target="_blank">lists.celestial.com</a> [mailto:<a href="mailto:filepro-">filepro-</a><br>

&gt; list-bounces+rkreiss=<a href="http://verizon.net" target="_blank">verizon.net</a>@<a href="http://lists.celestial.com" target="_blank">lists.celestial.com</a>] On Behalf Of John Esak<br>
&gt; Sent: Tuesday, February 02, 2010 8:38 AM<br>
&gt; To: &#39;Tyler Style&#39;<br>
&gt; Cc: <a href="mailto:filepro-list@lists.celestial.com">filepro-list@lists.celestial.com</a><br>
</div><div><div></div><div class="h5">&gt; Subject: RE: rreport gagging on lockfile<br>
&gt;<br>
&gt; Well, let&#39;s see. If you were calling the clerk or report from SSTEM, then<br>
&gt; yes the lockfile would obstruct things first... But if you are already in<br>
&gt; clerk, it won&#39;t and if you are in report (using the -u optino) it won&#39;t.<br>
&gt; That&#39;s why I was looking for the exact way you launch this stuff.  Maybe you<br>
&gt; put it in the last note... I&#39;m not sure.  But in any cvase, assuming the<br>
&gt; debugger does come up... It will be on the automatic table if there is<br>
&gt; one... And the -z table otherwise.  If you put the debug on command at the<br>
&gt; top of the prc which does the system call, then you should be able to step a<br>
&gt; line at a time to the system call... At which point you can check the<br>
&gt; lockfile (before and after) the system command and see what happens.<br>
&gt;<br>
&gt; Incidentally, how do you do a lookup to a &quot;random&quot; record to keep it from<br>
&gt; &quot;hogging&quot; the file.  Is it possible you are getting the record you are<br>
&gt; standing on... Which actually is possible to get in &quot;write&quot; mode because<br>
&gt; filePro knows you are the user doing the lookup.  This might be causing the<br>
&gt; hassle.  I&#39;m curious if you actually use RAND or what?  The way I normally<br>
&gt; do what I think you&#39;re doing is do a lookup free, write that record... Grab<br>
&gt; the record number, then do a lookup - to that record number.  When the<br>
&gt; process is done, delete that record.  It has always been the cleanest way<br>
&gt; for me.<br>
&gt;<br>
&gt; Also, let me re-trace back to the previous paragraph . You mention having<br>
&gt; the file open with report on one screen and then clerk locks on another. The<br>
&gt; report on the first screen does have the -u on the command line, right?<br>
&gt; Otherwise, the clerk should rightfully be locked out.<br>
&gt;<br>
&gt; John<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; &gt; -----Original Message-----<br>
&gt; &gt; From: Tyler Style [mailto:<a href="mailto:tyler.style@gmail.com">tyler.style@gmail.com</a>]<br>
&gt; &gt; Sent: Tuesday, February 02, 2010 8:17 AM<br>
&gt; &gt; To: <a href="mailto:john@valar.com">john@valar.com</a><br>
&gt; &gt; Cc: <a href="mailto:filepro-list@lists.celestial.com">filepro-list@lists.celestial.com</a><br>
&gt; &gt; Subject: Re: rreport gagging on lockfile<br>
&gt; &gt;<br>
&gt; &gt; Yup, use the debugger all the time.  But not sure exactly<br>
&gt; &gt; what I would<br>
&gt; &gt; be looking for while debugging?  As far as I can tell, the<br>
&gt; &gt; error blocks<br>
&gt; &gt; all access to rclerk and rreport, so the debugger would likely never<br>
&gt; &gt; even start.  I&#39;ll be giving it a whirl, tho.<br>
&gt; &gt;<br>
&gt; &gt; John Esak wrote:<br>
&gt; &gt; &gt; Only thing I can suggest at this point is run the process with the<br>
&gt; &gt; &gt; interactive debugger. Completely lcear the lockfile before<br>
&gt; &gt; starting. (I mean<br>
&gt; &gt; &gt; erase it).  Then step through each critical point until you<br>
&gt; &gt; can see exactly<br>
&gt; &gt; &gt; what is causing the hang.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Are you familiar with the debugger?<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; John<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;&gt; -----Original Message-----<br>
&gt; &gt; &gt;&gt; From: Tyler Style [mailto:<a href="mailto:tyler.style@gmail.com">tyler.style@gmail.com</a>]<br>
&gt; &gt; &gt;&gt; Sent: Monday, February 01, 2010 11:23 PM<br>
&gt; &gt; &gt;&gt; To: <a href="mailto:john@valar.com">john@valar.com</a><br>
&gt; &gt; &gt;&gt; Cc: <a href="mailto:filepro-list@lists.celestial.com">filepro-list@lists.celestial.com</a><br>
&gt; &gt; &gt;&gt; Subject: Re: rreport gagging on lockfile<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; John Esak wrote:<br>
&gt; &gt; &gt;&gt;  &gt; 1. Okay, be more specific. You say you are using the lockinfo<br>
&gt; &gt; &gt;&gt; script.  So, you can see exactly which record is being locked<br>
&gt; &gt; &gt;&gt; by exactly<br>
&gt; &gt; &gt;&gt; which binary.  What does it show?  Record 1 by dclerk, or<br>
&gt; &gt; record 1 by<br>
&gt; &gt; &gt;&gt; dreport.... exactly what does lockinfo show.... by any<br>
&gt; &gt; chance are you<br>
&gt; &gt; &gt;&gt; locking record 0?  Not something you could do specificially,<br>
&gt; &gt; &gt;&gt; but filePro<br>
&gt; &gt; &gt;&gt; does this from time to time.<br>
&gt; &gt; &gt;&gt; While I have the error message from rreport on one terminal<br>
&gt; &gt; &gt;&gt; and the same<br>
&gt; &gt; &gt;&gt; error message from rclerk on another, lockinfo will produce<br>
&gt; &gt; &gt;&gt; &quot;There are<br>
&gt; &gt; &gt;&gt; NO locks on the &quot;log_operations&quot; key file.&quot;<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; While every call to rreport starts off with -sr 1, there is a<br>
&gt; &gt; &gt;&gt; lookup -<br>
&gt; &gt; &gt;&gt; in the processing that moves it to a random record (between 1<br>
&gt; &gt; &gt;&gt; and 180)<br>
&gt; &gt; &gt;&gt; as the first command to keep it from hogging the file.<br>
&gt; &gt; Records 1-180<br>
&gt; &gt; &gt;&gt; all exist.<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt;  &gt; 2. It&#39;s always easier when people say this has worked for<br>
&gt; &gt; &gt;&gt; years.  So,<br>
&gt; &gt; &gt;&gt; it must be something new added to the soup.  Have you removed<br>
&gt; &gt; &gt;&gt; an index,<br>
&gt; &gt; &gt;&gt; grown a field and not changed the size an index pointing<br>
&gt; &gt; to it.  Gone<br>
&gt; &gt; &gt;&gt; past some imposed time barrier?  Used up too many<br>
&gt; &gt; licenses? Exceeded<br>
&gt; &gt; &gt;&gt; some quota in some parameter?  Added groups or changed<br>
&gt; &gt; &gt;&gt; permissions?  Run<br>
&gt; &gt; &gt;&gt; a fixmog (fix permissions)?  Has a binary failed like dclerk<br>
&gt; &gt; &gt;&gt; and you&#39;ve<br>
&gt; &gt; &gt;&gt; replaced it with a different copy?   Has the -u flag any<br>
&gt; &gt; &gt;&gt; immpact on your<br>
&gt; &gt; &gt;&gt; scenario?  I&#39;m assuming a lot because you haven&#39;t<br>
&gt; &gt; &gt;&gt; specifically shown how<br>
&gt; &gt; &gt;&gt; you are doing things?  Is this happening from a system call?<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; Absolutely nothing has done to change the file or the<br>
&gt; &gt; &gt;&gt; processing for a<br>
&gt; &gt; &gt;&gt; couple years.  The only thing that has happened to the file<br>
&gt; &gt; &gt;&gt; is that it<br>
&gt; &gt; &gt;&gt; has grown larger over time.<br>
&gt; &gt; &gt;&gt; There is definitely no time limit imposed in the processing;<br>
&gt; &gt; &gt;&gt; I don&#39;t see<br>
&gt; &gt; &gt;&gt; how would that produce a lock issue, anyway?<br>
&gt; &gt; &gt;&gt; We have way more licenses than we can use after cutting 70%<br>
&gt; &gt; &gt;&gt; of our staff<br>
&gt; &gt; &gt;&gt; last year :P<br>
&gt; &gt; &gt;&gt; Exceeding a quota in a parameter would mean something had<br>
&gt; &gt; &gt;&gt; changed with<br>
&gt; &gt; &gt;&gt; the file or processing, and nothing has.<br>
&gt; &gt; &gt;&gt; We haven&#39;t changed groups or permissions in years either -<br>
&gt; &gt; &gt;&gt; the current<br>
&gt; &gt; &gt;&gt; setup is pretty static.<br>
&gt; &gt; &gt;&gt; Fixmog (our version is called &#39;correct&#39;) hasn&#39;t been executed<br>
&gt; &gt; &gt;&gt; in months<br>
&gt; &gt; &gt;&gt; according to the log it keeps.<br>
&gt; &gt; &gt;&gt; No binaries have been swapped in or out (we&#39;d like to tho!<br>
&gt; &gt; &gt;&gt; still haven&#39;t<br>
&gt; &gt; &gt;&gt; got 5.6 to pass all our tests on our test box unfortunately)<br>
&gt; &gt; &gt;&gt; -u shouldn&#39;t make any diff; it&#39;s not used and if we needed to<br>
&gt; &gt; &gt;&gt; use it I<br>
&gt; &gt; &gt;&gt; am certain the need would have shown up sometime prior to this.<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; A typical use would be to add this to the end of a bash<br>
&gt; &gt; &gt;&gt; script to record<br>
&gt; &gt; &gt;&gt; that a script had completed running:<br>
&gt; &gt; &gt;&gt; ARGPM=&quot;file=none;processing=none;qualifier=hh;script=importshi<br>
&gt; &gt; &gt;&gt; p;user=$LOGNAME;no<br>
&gt; &gt; &gt;&gt; te=none;status=COMPLETED&quot;<br>
&gt; &gt; &gt;&gt; /appl/fp/rreport log_operations -fp log_it -sr 1 -r $ARGPM -h<br>
&gt; &gt; &gt;&gt; &quot;Logging&quot;<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; Most of the actual processing just parses @PM, looks up a<br>
&gt; &gt; &gt;&gt; free record,<br>
&gt; &gt; &gt;&gt; and puts data in the correct fields.<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; No other processing anywhere ever looks up the file; it is<br>
&gt; &gt; strictly a<br>
&gt; &gt; &gt;&gt; log, nothing more, and the only processing that touches it<br>
&gt; &gt; (log_it)<br>
&gt; &gt; &gt;&gt; always either run via a script command or a SYSTEM command.<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; Things we tried to see if they would help:<br>
&gt; &gt; &gt;&gt; * file had 600,000 records going back 4yrs, so we copied<br>
&gt; &gt; the data to<br>
&gt; &gt; &gt;&gt; another qualifier, deleted the original qualifier, and<br>
&gt; &gt; copy back the<br>
&gt; &gt; &gt;&gt; most recent 10,000 entries to see if it was just a size issue.<br>
&gt; &gt; &gt;&gt; * rebuilt all the indices.<br>
&gt; &gt; &gt;&gt; * rebooting the OS.<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; This logging hasn&#39;t been added to any new processing or<br>
&gt; &gt; scripts for<br>
&gt; &gt; &gt;&gt; several months.<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt;  &gt;<br>
&gt; &gt; &gt;&gt;  &gt; I agree that the code would not seem to be importatn<br>
&gt; &gt; since it has<br>
&gt; &gt; &gt;&gt; worked... before, so again, it seems like the environment<br>
&gt; &gt; has changed<br>
&gt; &gt; &gt;&gt; somehow.  Maybe if we saw the whole setup, relevant code<br>
&gt; &gt; and all we<br>
&gt; &gt; &gt;&gt; could give more suggestions.  Oh, I just thought of one... is it<br>
&gt; &gt; &gt;&gt; possible you are looking up to a particular record, say<br>
&gt; &gt; &gt;&gt; record 1... and<br>
&gt; &gt; &gt;&gt; that record is not there anymore?<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; All the records being looked up to exist.  The environment<br>
&gt; &gt; is pretty<br>
&gt; &gt; &gt;&gt; static - our needs have been pretty clearly defined by<br>
&gt; &gt; this point and<br>
&gt; &gt; &gt;&gt; new systems are almost always implemented on our Debian boxes<br>
&gt; &gt; &gt;&gt; as SCO is<br>
&gt; &gt; &gt;&gt; so limiting and so badly supported.<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; Thanks for the ideas!  Hopefully my answers might light up a<br>
&gt; &gt; &gt;&gt; bulb over<br>
&gt; &gt; &gt;&gt; someone&#39;s head...<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt; Tyler<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;&gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Filepro-list mailing list<br>
&gt; <a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a><br>
&gt; <a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>
<br>
<br>
</blockquote></div><br>