<div dir="ltr"><div>Seems to me it&#39;s going thru @sbrk1 after each record.....I put a &#39;beep;msgbox...&#39; statement in @sbrk as shown and it increases each time I hit enter</div><div>Here are the records I have in the file:</div>
<div> </div><div>2435-0126</div><div>3194-0143</div><div>3194-0144</div><div>3194-0145</div><div>3981-0059</div><div>5499-0086</div><div>5499-0087</div><div>5499-0088</div><div>5499-0090</div><div>5499-0091</div><div> </div>
<div>So my processing now looks like this:</div><div> </div><div>:1=&quot;&quot;:end::</div><div>@sbrk1::aa(4,#,g)=mid(3,&quot;6&quot;,&quot;4&quot;);beep;msgbox &quot;Value of aa is&quot;&lt;aa    &#39;this is the lowest acct number:</div>
<div>::end:</div><div>@wbrk1::ab(4,#,g)=mid(3,&quot;6&quot;,&quot;4&quot;)  &#39;this is the highest acct number:</div><div>::lookup cli = client  k=1   i=A  -nx:</div><div>::ac(30,uplow)=cli(2) :</div><div>::end:</div><div>
 </div><div>I have tried this with both &quot;,g&quot; and without &quot;,g&quot;</div><div>If I use &quot;,g&quot; then aa and ab are always the same (the highest number, ab)</div><div>If I don&#39;t use &quot;,g&quot; then aa is always black, but ab is correct</div>
<div> </div><div>My sort information is:</div><div> </div><div>  Sort field     :   1    |  2</div><div>  Length        :   4    |  4</div><div>  Descending:         |</div><div>Subtotal field:    x   |</div><div> </div><div>
When I run this on all records, the msgbox I get happens in this order (after each record, it&#39;s giving me the value of the acct number)</div><div> </div><div>Value of aa is 0126   I hit enter, still shows</div><div>Value of aa is 0126   then it prints the page</div>
<div> </div><div>Value of aa is 0143   I hit enter</div><div>Value of aa is 0144   I hit enter</div><div>Value of aa is 0145   I hit enter and it prints the page</div><div> </div><div>Value of aa is 0059   I hit enter, still shows</div>
<div>Value of aa is 0059   I hit enter and it prints the page</div><div> </div><div>Value of aa is 0086   I hit enter, still shows</div><div>Value of aa is 0086   I hit enter, shows</div><div>Value of aa is 0087   I hit enter, shows</div>
<div>Value of aa is 0088   I hit enter, shows</div><div>Value of aa is 0090   I hit enter, shows</div><div>Value of aa is 0091   I hit enter and it prints the page</div><div> </div><div>Processing ends......</div><div> </div>
<div>Not sure why aa would return different values each time I hit enter, if in fact the subtotal is on client number....should only hit @sbrk1 when it reaches a different client number, right??</div><div> </div><div> </div>
<div> </div><div> </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 14, 2014 at 3:47 PM, Bruce Easton <span dir="ltr">&lt;<a href="mailto:bruce@stn.com" target="_blank">bruce@stn.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Scott, for the report to do what you need it to do, I would think you<br>
want it in client, then account order (so that it hits the lowest acct#<br>
first and the highest last within a client).  If you look back at Ken&#39;s<br>
initial reply on this, his first paragraph gives the answer, but, based<br>
on what we knew at that time, we only knew about the one combined field<br>
(which seems to be field #3).  So with those dummy fields global and<br>
&quot;end&quot;ing the @sbrk1 section, it should work the way he described if you<br>
sort on your field 3, but overriding the length of the sort to be 4.<br>
(Also, since we now know you have the other parts of the key stored<br>
separately, you could alternatively make the sort composite and sort on<br>
all of field 1 and then at the next level on all of field 2 and only<br>
specify to sub-total break (with the &quot;x&quot;) on the level that&#39;s on field 1.)<br>
<div><br>
Bruce<br>
<br>
<br>
On 7/14/14 3:12 PM, <a href="mailto:scooter6@gmail.com">scooter6@gmail.com</a> wrote:<br>
</div><div>&gt; Here is the &#39;structure&#39; part of the file that&#39;s pertinent<br>
&gt; Field 1 = 4,#  is the client number   &#39; in the examples here, that is<br>
&gt; 2435, 3194 &amp; 5498  - this is what it should sort on - a new page for<br>
&gt; each unique client number<br>
&gt; Field 2 = 4,allup  is the account number  &#39;in the examples here, that<br>
&gt; is what comes after the &quot;-&quot; 0001, 0002 for client 2435, 0143, 0144,<br>
&gt; 0145 for client 3194<br>
&gt; Field 3 = 9,allup  is the two fields combined  with a &quot;-&quot; in middle<br>
&gt; &#39;i.e. 2435-0001, 2435-0002, 3194-0143, etc<br>
&gt; So since the file has the client number in a field already, I have it<br>
&gt; sorting on field 1 with a length of 4 - which appears to be okay,<br>
&gt; since it&#39;s doing what I want it to do, except it&#39;s not finding the<br>
&gt; &#39;lowest&#39; account number...otherwise, everything works fine haha<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Jul 14, 2014 at 3:04 PM, Bruce Easton &lt;<a href="mailto:bruce@stn.com">bruce@stn.com</a><br>
</div><div>&gt; &lt;mailto:<a href="mailto:bruce@stn.com">bruce@stn.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Scott - check the sort screen for this - did you sort on Account<br>
&gt;     Number,<br>
&gt;     but only for a length of four?<br>
&gt;<br>
&gt;     Bruce<br>
&gt;<br>
</div>&gt;     On 7/14/14 2:55 PM, <a href="mailto:scooter6@gmail.com">scooter6@gmail.com</a> &lt;mailto:<a href="mailto:scooter6@gmail.com">scooter6@gmail.com</a>&gt;<br>
<div>&gt;     wrote:<br>
&gt;     &gt; adding &#39;end&#39; in @sbrk1 had no effect - aa is still equal to ab<br>
&gt;     on all<br>
&gt;     &gt; pages<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; On Mon, Jul 14, 2014 at 2:47 PM, Bruce Easton &lt;<a href="mailto:bruce@stn.com">bruce@stn.com</a><br>
&gt;     &lt;mailto:<a href="mailto:bruce@stn.com">bruce@stn.com</a>&gt;<br>
</div><div>&gt;     &gt; &lt;mailto:<a href="mailto:bruce@stn.com">bruce@stn.com</a> &lt;mailto:<a href="mailto:bruce@stn.com">bruce@stn.com</a>&gt;&gt;&gt; wrote:<br>
&gt;     &gt;<br>
&gt;     &gt;     Ah yes, the lack of &quot;end&quot; for @sbrk1 is probably why your aa<br>
&gt;     is being<br>
&gt;     &gt;     set to your ab.<br>
&gt;     &gt;<br>
&gt;     &gt;     Bruce<br>
&gt;     &gt;<br>
&gt;     &gt;     On 7/14/14 2:33 PM, Kenneth Brody wrote:<br>
&gt;     &gt;     &gt; On 7/14/2014 1:57 PM, <a href="mailto:scooter6@gmail.com">scooter6@gmail.com</a><br>
&gt;     &lt;mailto:<a href="mailto:scooter6@gmail.com">scooter6@gmail.com</a>&gt;<br>
</div><div>&gt;     &gt;     &lt;mailto:<a href="mailto:scooter6@gmail.com">scooter6@gmail.com</a> &lt;mailto:<a href="mailto:scooter6@gmail.com">scooter6@gmail.com</a>&gt;&gt; wrote:<br>
&gt;     &gt;     &gt;&gt; Ken,<br>
&gt;     &gt;     &gt;&gt;<br>
&gt;     &gt;     &gt;&gt; Here is what my output processing looks, with sort on client<br>
&gt;     &gt;     number (4<br>
&gt;     &gt;     &gt;&gt; characters and subtotal) and then full account number<br>
&gt;     &gt;     &gt;&gt; Everything works great except the &#39;starting (lowest)&#39;<br>
&gt;     number -<br>
&gt;     &gt;     that is<br>
&gt;     &gt;     &gt;&gt; coming out blank<br>
&gt;     &gt;     &gt;&gt;<br>
&gt;     &gt;     &gt;&gt; :1=&quot;&quot;:end::gP*P|VW_L&amp;4foSDs:<br>
&gt;     &gt;     &gt;&gt; @sbrk1::aa(4,#)=mid(3,&quot;6&quot;,&quot;4&quot;)  &#39;this is the lowest number:<br>
&gt;     &gt;     &gt; aa(4,#,g)=mid(3,&quot;6&quot;,&quot;4&quot;) ; end<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;&gt; @wbrk1::ab(4,#)=mid(3,&quot;6&quot;,&quot;4&quot;) &#39;this is the highest number:<br>
&gt;     &gt;     &gt;&gt; ::lookup cli=client  k=1   i=A -nx:<br>
&gt;     &gt;     &gt;&gt; ::ac(30,uplow)=cli(2) &#39; this grabs the name of the client:<br>
&gt;     &gt;     &gt;&gt; ::end:<br>
&gt;     &gt;     &gt; [...]<br>
&gt;     &gt;     &gt;&gt; Any idea why &#39;aa&#39; starting number is coming back blank?<br>
&gt;     &gt;     &gt; [...]<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; No &quot;,g&quot; flag.<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;     _______________________________________________<br>
&gt;     &gt;     Filepro-list mailing list<br>
&gt;     &gt; <a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a><br>
&gt;     &lt;mailto:<a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a>&gt;<br>
</div>&gt;     &gt;     &lt;mailto:<a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a><br>
<div>&gt;     &lt;mailto:<a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a>&gt;&gt;<br>
&gt;     &gt;     Subscribe/Unsubscribe/Subscription Changes<br>
&gt;     &gt; <a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;<br>
&gt;     -------------- next part --------------<br>
&gt;     An HTML attachment was scrubbed...<br>
&gt;     URL:<br>
&gt;     <a href="http://mailman.celestial.com/pipermail/filepro-list/attachments/20140714/c48dae8d/attachment.html" target="_blank">http://mailman.celestial.com/pipermail/filepro-list/attachments/20140714/c48dae8d/attachment.html</a><br>

&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;     &lt;mailto:<a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a>&gt;<br>
&gt;     Subscribe/Unsubscribe/Subscription Changes<br>
&gt;     <a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>
&gt;<br>
&gt;<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
</div>URL: <a href="http://mailman.celestial.com/pipermail/filepro-list/attachments/20140714/836a6b5a/attachment.html" target="_blank">http://mailman.celestial.com/pipermail/filepro-list/attachments/20140714/836a6b5a/attachment.html</a><br>

<div class="HOEnZb"><div class="h5">_______________________________________________<br>
Filepro-list mailing list<br>
<a href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a><br>
Subscribe/Unsubscribe/Subscription Changes<br>
<a href="http://mailman.celestial.com/mailman/listinfo/filepro-list" target="_blank">http://mailman.celestial.com/mailman/listinfo/filepro-list</a><br>
</div></div></blockquote></div><br></div>