Writing out multiple records to a subfile from a single recor
d
Bruin, J.M. de
Bruin@WT.TNO.NL
Thu, 7 Jun 2001 19:20:01 +0200
Thanks for the complement John,
though I must add it's not completely my 'technique', but it is as you've said,
a very useful technique.
I do in fact use it myself for quite a number of jobs, quiz as well as qtp.
An 'example' from my side is that I use it for 'outlining' parallel columns with
an unbalanced # of entries which have to be on the same 'height' in the report.
Thus linking via a file as you've mentioned twice (for 2 columns) I always come
up the same and correct number of 'complexes' and the same 'index' for
corresponding records.
What I like most about it is the fact that you can easily change the # of
required records, especially compared with the huge amount of effort when using
aliases and/or subsequent passes. (my experience is that you start copying
things and then edit them, but you'll always end up with at least 3
mistakes/mistypes and while everything looks the same, a typo error is usually
hard to see)
Mark
> -----Original Message-----
> From: Pickering, John (NORBORD) [mailto:PICKERIJ@norbord.com]
> Sent: Thursday, June 07, 2001 17:40
> To: 'Bruin, J.M. de'; 'George_DeWolf@midhosp.org'; 'Powerhouse List'
> Subject: RE: Writing out multiple records to a subfile from a single
> recor d
>
>
> Good suggestion Mark.
>
> I have found this technique quite useful. Useful to the extent that my
> database has a table called LOOPS. For key value 1 there is 1
> record; for
> key value 2 there are 2 records; for key value 3 there are 3
> records; I
> think you get the picture. There is also a column with the
> record number
> within the key value. I think the unique key (for those databases that
> insist on having a unique key) is "1 of 2", "2 of 2", etc.
>
> I have an import job which validates the data much as for
> George's edit
> task. Rather than multiple passes to check a hundred or so
> error conditions
> I access all of the tables necessary for validation and then
> to a specific
> key in the LOOPS table. Linking to key value 5 allows me to
> check 100 error
> conditions with 20 subfile statements.
>
> Then the code looks something like:
> >define d_error_1 char*30 &
> > = "error message one" &
> > if 1 = record_no of loops and [error condition 1] &
> > else "error message two" &
> > if 2 = record_no of loops and [error condition 2] &
> > else "error message three" &
> > if 3 = record_no of loops and [error condition 3] &
> > else "error message four" &
> > if 4 = record_no of loops and [error condition 4] &
> > else "error message five" &
> > if 5 = record_no of loops and [error condition 5]
> >subfile errors alias errors_1 append &
> > if "" ne d_error_1 include [whatever],d_error_1
>
> This is repeated so that there are 20 defines and 20 subfile
> statements
> giving 100 errors.
>
> I have also found this LOOPS table useful for creating
> varying numbers of
> copies with Quiz. The receiving dock wants a label to stick
> to each item
> received. If they receive 10 bearings, they want 10 labels.
> On the same
> receipt there might be 5 of something else requiring 5
> labels. And for a 4
> litre jug of goop they only want one label even though they received 4
> litres. The Quiz label program simply links
> "number_of_labels" to the key of
> LOOPS.
>
> Regards,
> JWP
>
> > -----Original Message-----
> > From: Bruin, J.M. de [SMTP:Bruin@wt.tno.nl]
> > Sent: Thursday, June 07, 2001 4:02 AM
> > To: powerh-l@lists.swau.edu
> > Subject: RE: Writing out multiple records to a subfile
> from a single
> > recor d
> >
> > Why not 'create' multiple record complexes using a
> additional file with
> > 'dummy'
> > records in it?
> > And output to subfile if condition occurs with one of the complexes?
> > Haven't tried it and haven't worked it out, but .......
> > This way you won't have to bother about the # of files etc.
> /request/run
> >
> >
> > Mark
> >
> > -----Original Message-----
> > From: George_DeWolf@midhosp.org [mailto:George_DeWolf@midhosp.org]
> > Sent: Thursday, June 07, 2001 03:05
> > To: powerh-l@lists.swau.edu
> > Subject: Writing out multiple records to a subfile from a
> single record
> >
> >
> > Many thanks to all that responded to my question about
> writing multiple
> > records to a subfile from a single record. I will be using multiple
> > SUBFILE
> > {name} ALIAS {alias} IF {condition} statements to create
> the multiple
> > records. Thanks, in particular for the information on
> maximum number of
> > subfiles which can be declared. I will definitely exceed
> the limit of 63
> > file declarations so will need to use multiple passes.
> >
> > George DeWolf
> > Middlesex Hospital
> >
> >
>
> = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> Mailing list: powerh-l@lists.swau.edu
> Subscribe: "subscribe" in message body to
> powerh-l-request@lists.swau.edu
> Unsubscribe: "unsubscribe" in message body to
> powerh-l-request@lists.swau.edu
> http://lists.swau.edu/mailman/listinfo/powerh-l
> This list is closed, thus to post to the list you must be a
> subscriber.
>