multiple field index
Jose Lerebours
fpgroups at gmail.com
Tue Dec 22 14:52:39 PST 2015
No, you do not have to, just make sure you are checking the proper field
and understand that a normal record may appear multiple times, once for
each instance of 'true' being met according to your search criteria.
So, if I were to mimic what you said, as I understand it: One record
can be split into multiple payments and you have allocated scheduled
payments within the record
I figure I would have my map to look like this
a1) date 1
a1) date 2
a1) date 3
a1) date 4
....
a2) amount 1
a2) amount 2
a2) amount 3
a2) amount 4
....
a3) cc # 1
a3) cc # 2
a3) cc # 3
a3) cc # 4
...
a4) appv code 1
a4) appv code 2
a4) appv code 3
a4) appv code 4
...
a5) error 1
a5) error 2
a5) error 3
a5) error 4
...
So, given this setup, you can have these anywhere within your map they
just need to be properly paired so that filePro can do its thing as you
would expect it.
Now, all you have to do is set your selection criteria based on a1) and
process the payment|export based on "associated fields" a2, a3, a4, a5
and if you need to use a field(s) outside the "associated block", then
do so as you normally would in filePro - 1, 2, 3, 4, 5 ...
As far as the export is concerned, I always like to use dynamic file
names and place the export command in a "subroutine - gosub mkexp" so
that I can have multiple routines create any number of export files and
not run into the problem that ONLY one export command per processing
table (not sure if this is still true today).
:then: fn="/tmp/put-it-here.txt"; gosub MKEXP
:then: ref(1)=a1); ref(2)=a2); ref(3)=a3); ref(4)=a4); ref(5)=1;
ref(6)=22; ref(7)=233;
:then: write ref; end
MKEXP:if:
:then: export ascii ref = (fn) r=\n f=, -A
:then: return
On 12/22/2015 05:40 PM, scooter6 at gmail.com wrote:
> Ok so to confirm - in order for this to work correctly, I would need
> the amounts in a separate associate field?
> Currently I have
> a1) Date
> a2)TransID (internal number)
>
> but I don't have the amount in a?) - so that's why if I have one
> transaction dated today for 50.00 and another dated tomorrow for 57.00
> - it has not way to associate the amount to the proper date?
> Or am I confused?
>
>
> On Tue, Dec 22, 2015 at 5:37 PM, Jose Lerebours via Filepro-list
> <filepro-list at lists.celestial.com
> <mailto:filepro-list at lists.celestial.com>> wrote:
>
> People, remember that associated records are exactly that, records
> within the record and you should not need to use @af to point to
> the instance of the "record" or "array"
>
> So, if you have a1, a2, a3, a4 ... b1, b2, b3, b4 ...
>
> selecting records based on a1 eq @td, you just need to reference
> the records based on their "associated field names", meaning, use
> a1, a2, a3, ... Use what we know as "real" fields if you need to
> use a field outside the associated block
>
> a1) Date
> a2) Pay Amount
> a3) Credit Card Number
> a4) Approval Code
>
> :if: a1 eq @td
> :then: goto DOIT
> :: end
> DOIT:if:
> :then: process payment if cc merchant
> :if: ccpayment went ok
> :then: a4=ccpayment approval code; write
> ::end
>
>
> or something to that effect.
>
> You only need to use @af you are not taking advantage of the
> "associated fields" ... Then again, there is a chance I am grossly
> mistaken and have used it wrong all these years. ;-)
>
> Hope all goes well!
>
>
>
>
>
>
> On 12/22/2015 05:25 PM, Mike Schwartz via Filepro-list wrote:
>
> I have created a file that can have up to 12 credit card
> transactions
>
> dated
>
> today or in the future...
>
> So each morning I want to send the current dated ones to
> be processed but
> think I'm having a brain cramp on this...
>
> I have 12 fields that are date fields (each shows as a1)
> Date of 1st Pmt
> a1) Date of 2nd Pmt, etc...then each has it's
> corresponding amount....
>
> How would I select records dated just today and grab the
> corresponding
> amount for that date?
>
> I have the index built and can search by that day, but do
> I need to 'step'
> though each of the 12 dates and if it matches today grab
> the amount in the
> amount field for that day?
>
> I tried this and am exporting these records but it only
> exports the last
>
> record
>
> it finds with today's date??
>
> Scott
> PDM
>
> Whenever you want multiple export lines to be written to
> the export
> file from within one filePro record you have to use a "write"
> command to
> "force" the write of the exported line out to the file.
>
> You don't have to "step" (loop) through the 12 fields if
> you use @AF
> (associated field instance). @AF knows which date instance
> (1-12) caused
> the index building to select the record.
>
> Mike Schwartz
>
>
>
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> <mailto:Filepro-list at lists.celestial.com>
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> <mailto:Filepro-list at lists.celestial.com>
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.celestial.com/pipermail/filepro-list/attachments/20151222/03716860/attachment.html>
More information about the Filepro-list
mailing list