<!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. I have included a screen shot of a record to use as
an example. My selection is based on a date range and the last three
characters of the department field (which is a union code). The date
criteria is generic to the whole record (not associated, one field for
this). My sorts need to be union code, job number and employee code.
<br>
<br>
RECORD NUMBER: 5
<br>
EMPLOYEE CODE: 789
<br>
<br>
DEPT JOB NO. COMP COST CODE RATE TYPE
HOURS EXTENSION
<br>
000D10 000000 DE953 5200¦ 000 39.50 R
8.00 316.00
<br>
228D10 228000 DE953 5200¦ 000 39.50
R 8.00 316.00
<br>
243D10 243000 DE953 5200¦ 000 39.50
R 8.00 316.00
<br>
266D20 266000 DE953 5200¦ 000 39.50
R 8.00 316.00
<br>
274D10 274000 DE953 5200¦ 000 39.50
R 8.00 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. In the
above example, 4 of the 5 lines would pass (the D10 union codes). 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. The index gives me this record 5 times but I only need
4. I need a way to determine the instance so I can filter out unneeded
instances and pass the correct job number to the sort. I thought @af
would work, but it reports a "1" each time I hit the record. 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. 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. 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.
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. It
would be possible to make a work file for each user to eliminate any
possible overlap if that could be an issue. ("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. With
programming time short I routinely use work files for this purpose.
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>