Subfiles and Subtotaling
Rohde Dirk (Van)
Dirk.Rohde@vpgroup.com
Mon, 22 Mar 1999 16:22:49 -0800
The defaults for subtotalling if you haven't specified them explicitly are
to total each record and to reset the total at your lowest sort level, which
means that you would be resetting when SC changes as required. Therefore,
you are probably writing the subfile at each record. Instead, you should be
writing the records "at" the sort key as follows:
set subfile name <subfile_name> at SORT1
This should get you what you need.
-----Original Message-----
From: Ravenscroft, Wanda L [mailto:WandaL.Ravenscroft@Energizer.com]
Sent: Monday, March 22, 1999 4:05 PM
To: powerh-l@lists.swau.edu
Subject: Subfiles and Subtotaling
I have a subfile that I've created. Following is an example of some data
that is in this subfile.
SC Type PC AC Cost
412 30917 A 4010813
413 30917 A 9042253
413 30917 A 4386797
414 30917 A 5765510
415 30917 A 22749072
470 30917 A 7949987
The first column is what we call sales class and the last column is a cost
field. As you can see, the value of 413 in column 1 is reported twice. I
want to subtotal on the last column and report the value of 413 only once.
I should end up with:
413 30917 A 13429050
When I report the cost column with the command subtotal on it, I get
413 30917 A 9042253
Can anybody tell me what it is I might be doing wrong? I do have this
working on another subfile and I don't appear to be doing anything
differently, but one never knows the little things that can go awry when it
comes to programming. In case my sort makes a difference, I have it defined
as follows:
Define SORT1 char*17 = Type + PC + ascii(SC)
PC as you can see is a blank in this case.
Any help that can be provided would be wonderful and very much appreciated.
Wanda Ravenscroft
Programmer Analyst
Eveready Battery Company
Open VMS 6.1, PH 7.10F1
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.