|
Son,
Piece of advice. If you are ever tasked with solving for depreciation,
cost of sales, income statement or balance sheet, don't do it - you'll hurt
yourself. And worse yet, probably anyone in the same building.
And do not, under any circumstances, operate heavy equipment.
Jerry C. Adams
IBM i Programmer/Analyst
Never trust a man who has not a single redeeming vice. -Winston Churchill
--
NMM&D
615-585-2175
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of
tim ken
Sent: Sunday, September 10, 2023 8:08 AM
To: RPG programming on IBM i
Subject: Re: Adding all the box quantities for a item
Hi,
There is no such limit because an item may have multiple such box ids
associated with it.
An Item id can not be duplicate, it's unique id.
Thanks
On Sun, Sep 10, 2023, 18:31 myibmi via RPG400-L <
rpg400-l@xxxxxxxxxxxxxxxxxx>
wrote:
How many box id's could an item contain?von
Duplicated id's in an item possible?
Sum each id?
In this case: use a DS array!
-----Ursprüngliche Nachricht-----
Von: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] Im Auftrag
tim kenOf
Gesendet: Sonntag, 10. September 2023 14:51
An: RPG programming on IBM i
Betreff: Re: Adding all the box quantities for a item
Hi,
But is no looping etc.( any loop logic inside rpgle or inside sqlrpgle
program) required to add all such quantities for all the associated box
ids for a specific item number here to display their sum on display file
screen here ?
Thanks
On Sun, Sep 10, 2023, 18:14 Jerry Adams <midrange@xxxxxxxx> wrote:
Aside from the fact this is a bad design, it is a simple matter, as
someone else suggested early on:
Total = qty1 + qty2 + .....
But that is so simple, I just know I missed something - again.
Jerry C. Adams
IBM i Programmer/Analyst
Tradition is just peer pressure from dead people.
--
NMM&D
615-585-2175
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf
alltim ken
Sent: Sunday, September 10, 2023 7:22 AM
To: RPG programming on IBM i
Subject: Re: Adding all the box quantities for a item
Thanks,
Just for more clarification it's a single file item master which has
screen),these fields in it item number (which we search on display file
andbox id, quantities for box id.
One item number mave one or more boxes andeach box has unique box id
itemit's quantity in the Quantity field.which
Considering this what would be the updated rpgle and sqlrpgle program
could display the sum of all the corresponding quantities for all such
boxes( I mean sum of quantities associated with each box id) for an
specificnumber on display file screen ?figure
Thanks much...
On Sun, Sep 10, 2023, 17:13 Jerry Adams <midrange@xxxxxxxx> wrote:
Please excuse me if I missed it, but, like Daniel, I am trying to
seemsout exactly what the objective is here. Superficially, I admit, it
simple: How much (quantity) do we have in the warehouse for a
Lotitem. But it could be that we want to know how much is available for
shipment (unallocated).
As Daniel said two tables are needed: (1) an Item Master, and (2) a
talkingforInventory. The Lot Inventory is needed only, in my experience, for
inventory valuation at month-end; i.e., each Lot (or Box) was bought
a
different prices. Here, by the way, I am assuming that we are
thediscreteabout generic items, such as books, candy, etc., not high value,
isitems, such as jewelry that are inventoried, well, discretely.
If all you want to know is how much of any item, regardless of price,
in inventory, then an SQL over the Lot Table will suffice, as Danielsales,
illustrated. However, if you want to know how much is available for
then one must include any order allocation. That could be done in
itemLot
Table, but the minimum wage packers in the warehouse will pull the
ofthefrom whichever Lot (Box) is closest at the time. Because of that andother
quirks, I always keep the allocation in the Item Master and then, as
order is filled, reduce inventory in the Lot/Boxes since, at the end
inventorythe
day the auditors (usually) do not care which box was used.
This is, of course, a simplification; it ignores whether the
isNaturally,
valued on a FIFO or LIFO basis. That distinction is usually onlypertinent
when the order is filled and on-hand inventory is reduced.
whichyour
auditor’s rules may differ or vary somewhat. On the other hand, assomeone
else speculated earlier, this seems like a textbook exercise; in
andcase
ignore everything I said. If not, get the objective defined better
fewthe
rules needed to meet that objective.
Jerry C. Adams
IBM i Programmer/Analyst
What the world needs is more geniuses with humility. There are so
ofBehalf
us left.
--
NMM&D
615-585-2175
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On
Ofthe
Daniel Gross
Sent: Sunday, September 10, 2023 4:12 AM
To: RPG programming on IBM i
Subject: Re: Adding all the box quantities for a item
Hi Tim,
so I'm trying to understand and explain a solution.
First - I think you have one table (I will call it "items") with
incontainsitem
master data, and another table (I will call it "boxes") which
one
record for each box of records, and a quantity how many items are
willingforeach
box. Is this near?
If yes - simply use SQL to query both tables at the same time:
exec sql declare csrItemBoxes cursor for
select boxes.id,
max(boxes.item_id),
case
when boxes.id is not null
then max(items.description)
else "Total Quantities:"
end,
sum(boxes.quantity)
from boxes
join items on items.id = boxes.item_id
where boxes.item_id = :itemid
group by rollup (boxes_id);
Now this will give your cursor one line per box and a summary line
allthis
boxes.
Now loop through that cursor and add a subfile line for each row
fetched.
If the "boxes.id" field is "null", you have the summary line - in
line, the description field will be filled with the text "Totalline
Quantities:".
Maybe set a flag to give that line another color, and deactivate a
selection option field, because this is a summary line.training,
HTH
Daniel
P.S.: As far as I can see, you haven't received a proper RPGLE
and now you should change/maintain existing programs. Ask your
supervisor
to give you a proper training, find yourself a training
(like [1]systemideveloper.com) or find a tutor/coach who is
itemto
help you (for profit or not) - just my 2ct.
Am 09.09.2023 um 20:52 schrieb tim ken <timk2574@xxxxxxxxx>:
Hi,
They are like below :-
On display file screen (a subfile)
Enter item number :- .................
Once we enter item number then program need to look for this
thennumber
in
a item master file and if it successfully finds an item in it
beit
further checks corresponding boxes ( for each item there might
sameformultiple
such boxes in box id field of this same item master file) and
each
such box there is corresponding 'quantity' field is there in
screen.item
master file so we need to add all such quantities for all the
individual
boxes and then finally sum it up and show on display file
itemJust for more clarification:-
Box no. Quantity
Box 1 5
Box 2 7
Box 3 15
Then just for example if all the above 3 boxes are there for
specficnumber
'xyz' then
Program should be able to read this item master file for a
onitem
number which is entered on display file(which is a subfile with
record,
control, header and footer but does not contain column headings
thisdisplay
screen for these boxes but such multiple boxes are present in
onitem
master file for each such item number )
And then program should add quantities for all these boxes and
BY.Isthe
display file(subfile) it should be able to display like :- "Tot
Quantities: 27 Sum"
Thanks a lot.. ..
On Sun, Sep 10, 2023, 00:00 Glenn Gundermann
<glenn.gundermann@xxxxxxxxx>
wrote:
Sorry, my previous reply was incorrect. No need for GROUP
subscriptioneachquantity
box a
separate row in the item master table or is each box and
aitem_number
separate column in the same row? If the former:exec sqlSELECT
sum(quantity) INTO :totalQtyFROM item_master WHERE
=subscription
:itemNo;Your display file will define the field TOTALQTY.Yours
truly,Glenn
Gundermannglenn.gundermann@xxxxxxxxx(416) 317-3144
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any
related
questions.
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any
relatedrelatedrelated
questions.
References
Visible links
1. https://www.systemideveloper.com/
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
relatedquestions.
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
questions.--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
relatedquestions.
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
--questions.--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.