How to "ignore" records in a FIND procedure
Joe Boyle
atla38 at dsl.pipex.com
Mon Aug 21 02:22:01 CDT 2006
e.g.
file mydefef in mydb primary occurs 7 access request rownum &
unique using rownum
file fail_file in mydb secondary occurs with mydefef noitems open read
share
procedure find
begin
for mydefef
begin
if t_flag = "u"
then begin
get mydefef &
using rownum
let t_flag = "s"
end
else get mydefef seq
get filea
get fileb
.
if not (row is related to customer B)
then get fail_file using 'impossible string' via fail_file_col
end
end
_____
From: powerh-l-bounces+atla38=dsl.pipex.com at lists.sowder.com
[mailto:powerh-l-bounces+atla38=dsl.pipex.com at lists.sowder.com] On Behalf Of
fernando.olmos at hpa.com.au
Sent: 21 August 2006 07:31
To: powerh-l at lists.sowder.com
Subject: re: How to "ignore" records in a FIND procedure
Hi
Yes I tried that...
The problem is that the get in the FIND procedure ignores the fact that
there are other tables that are REQUIRED for the 1st table to even be
considered for the cluster of records.
I think a subfile in QUICK is the only solution...
FILE *MYSPECIFICDATA PRIMARY OCCURS 15
-----Original Message-----
From: atla38 at dsl.pipex.com [mailto:atla38 at dsl.pipex.com]
Sent: Monday, 21 August 2006 4:27 PM
To: Fernando Olmos; powerh-l at lists.sowder.com
Subject: RE: How to "ignore" records in a FIND procedure
Try something like this, you may have to add occurs with occurs-file,
File fail_row secondary noitems open read ..........( you will have to
create this and make sure no one adds any rows into it :-) )
In your find proc add syntax below, the below probably has to go in the for
loop after the fail-condition files have all been read
If fail-conditions-are-true
then get fail_row
A secondary without an optional will fail the primary row when not accessok.
_____
From: powerh-l-bounces+atla38=dsl.pipex.com at lists.sowder.com
[mailto:powerh-l-bounces+atla38=dsl.pipex.com at lists.sowder.com] On Behalf Of
fernando.olmos at hpa.com.au
Sent: 21 August 2006 05:07
To: powerh-l at lists.sowder.com
Subject: RE: How to "ignore" records in a FIND procedure
Just to add to this...
The way I've been trying to do it, is to place an INTERNAL call in the FIND
procedure to count the number of detail records and determine whether the
total is based on the requirements I need. This way I was hoping to pass
back to the FIND procedure a counter or a flag to say to the GET... ignore
this get or do get the record for the cluster (based on the FOR MISSING
clause).
Thanks
-----Original Message-----
From: Fernando Olmos
Sent: Monday, 21 August 2006 2:04 PM
To: powerh-l at lists.sowder.com
Subject: How to "ignore" records in a FIND procedure
Hi everyone.
How is it possible, with logic, to be able to ignore the occurrence of a
record being retrieved into a cluster, within a FIND procedure?
Obviously the ACCESS and SELECT clauses at the FILE definition level is the
quick answer, but what if you require complex logic to determine, based on
details records, whether a record in a cluster should be included or not ?
i.e. Here is the rows on my screen ...
Account Number Name
1234 Customer A -- this customer has 20
detail records where all records are not invoiced
1235 Customer B -- this customer has 10
detail records (orders) where 9 of 10 are flagged as invoiced and the last
rec is not invoiced
1236 Customer C -- this customer has 5
detail records where all records are invoiced.
I want to use some logic to only display CUSTOMER B in the cluster, on the
screen.
Fernando Olmos
MIS
Senior Analyst Programmer
HPA
Direct: 03 9217 5411
Mobile: 0410 382 857
Fax: 03 9217 5716
<file:///H:\Appdata\Microsoft\Signatures\www.hpa.com.au> www.hpa.com.au
**********************************************************************
IMPORTANT
The contents of this e-mail and its attachments are confidential and
intended
solely for the use of the individual or entity to whom they are addressed.
If
you received this e-mail in error, please notify the HPA Postmaster,
postmaster at hpa.com.au,
then delete the e-mail.
This footnote also confirms that this e-mail message has been swept for the
presence of computer viruses by Ironport. Before opening or using any
attachments, check them for viruses and defects.
Our liability is limited to resupplying any affected attachments.
HPA collects personal information to provide and market our services. For
more
information about use, disclosure and access see our Privacy Policy at
www.hpa.com.au
**********************************************************************
**********************************************************************
IMPORTANT
The contents of this e-mail and its attachments are confidential and
intended
solely for the use of the individual or entity to whom they are addressed.
If
you received this e-mail in error, please notify the HPA Postmaster,
postmaster at hpa.com.au,
then delete the e-mail.
This footnote also confirms that this e-mail message has been swept for the
presence of computer viruses by Ironport. Before opening or using any
attachments, check them for viruses and defects.
Our liability is limited to resupplying any affected attachments.
HPA collects personal information to provide and market our services. For
more
information about use, disclosure and access see our Privacy Policy at
www.hpa.com.au
**********************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.sowder.com/pipermail/powerh-l/attachments/20060821/d33a11b3/attachment-0001.htm
More information about the powerh-l
mailing list