<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Nancy Palmquist wrote:
<blockquote cite="mid442A9D0F.2080902@vss3.com" type="cite">Jaime Perry
wrote:
  <br>
  <blockquote type="cite">Hello,
    <br>
    <br>
I am having a problem with a report that is based on a file that
contains several grouping of associated fields that can contain up to
10 elements each.&nbsp; I have included a screen shot of a record to use as
an example.&nbsp;&nbsp; My selection is based on a date range and the last three
characters of the department field (which is a union code).&nbsp; The date
criteria is generic to the whole record (not associated, one field for
this).&nbsp; My sorts need to be union code, job number and employee code.
    <br>
&nbsp;
    <br>
&nbsp;RECORD NUMBER: 5
    <br>
&nbsp;EMPLOYEE CODE:&nbsp; 789
    <br>
    <br>
&nbsp;DEPT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; JOB NO.&nbsp;&nbsp; COMP&nbsp;&nbsp;&nbsp; COST CODE&nbsp;&nbsp;&nbsp; RATE&nbsp;&nbsp; TYPE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
HOURS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EXTENSION
    <br>
&nbsp;000D10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 000000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DE953&nbsp;&nbsp;&nbsp; 5200&brvbar; 000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 39.50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; R&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 316.00
    <br>
&nbsp;274D10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 274000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DE953&nbsp;&nbsp;&nbsp; 5200&brvbar; 000&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 39.50&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
R&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 8.00&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 316.00
    <br>
    <br>
My problem is that I need to select and sort the record for each
instance where the union code matches the selection criteria.&nbsp; In the
above example, 4 of the 5 lines would pass (the D10 union codes).&nbsp;&nbsp; I
built an index on the job number associated field (J1) and this works
fine as far as letting me select the record multiple times, but the
real problem I am having is that I cannot determine which instance I am
dealing with.&nbsp; The index gives me this record 5 times but I only need
4.&nbsp; I need a way to determine the instance so I can filter out unneeded
instances and pass the correct job number to the sort.&nbsp; I thought @af
would work, but it reports a "1" each time I hit the record.&nbsp; I am not
sure if @af is supposed to work in a selection process or not or if
some environmental variable is set wrong/not set that affects @af.&nbsp; If
there is another way to select a record more than once, that would work
as well.
    <br>
Thank you
    <br>
Jaime Perry
    <br>
    <br>
_______________________________________________
    <br>
Filepro-list mailing list
    <br>
<a class="moz-txt-link-abbreviated" href="mailto:Filepro-list@lists.celestial.com">Filepro-list@lists.celestial.com</a>
    <br>
<a class="moz-txt-link-freetext" href="http://mailman.celestial.com/mailman/listinfo/filepro-list">http://mailman.celestial.com/mailman/listinfo/filepro-list</a>
    <br>
    <br>
    <br>
  </blockquote>
Jamie,
  <br>
  <br>
I am not usually a proponent of a work file, but for sanity sake this
might be a good example where it is very helpful and saves a bunch of
programming time.
  <br>
  <br>
Set up a file with the data fields you need to generate the sorts,
selections and report output you need.
  <br>
  <br>
Clear the file.&nbsp; Then add a record for each associated occurance in the
data that you want to consider.
  <br>
  <br>
Once that is done, the selections, sorts and reports are very simple.
  <br>
  <br>
Your complex sort and selection can make this solution very attractive.
&nbsp;Of course, you can do it with the associated field logic but it can be
tricky.
  <br>
  <br>
Since the work file is cleared and loaded each time, it is important
that two users are not running the same report at the same time.&nbsp; It
would be possible to make a work file for each user to eliminate any
possible overlap if that could be an issue.&nbsp; ("key"{@id on Unix, who
knows on windows.)
  <br>
  <br>
Nancy
  <br>
  <br>
</blockquote>
<font face="Courier New, Courier, monospace">Jamie,<br>
<br>
I don't have Nancy's skills in dealing with associated fields.&nbsp; With
programming time short I routinely use work files for this purpose.&nbsp;
Most clients are using Linux/Unix so I edit the /etc/profile to set an
environment variable called TTY. (TTY=`tty` export TTY)<br>
<br>
I use this to set the first field of my work file to allow multiple
users to run these type of programs.<br>
<br>
Richard<br>
<br>
<br>
</font>
</body>
</html>