ideas - IBM AS400

This is a discussion on ideas - IBM AS400 ; Okay, I need some brain-power and I confess, more than I possess, if anyone wants a challenge; I'm not trying to get you to do my job for me, but I'm not afraid to admit I could use some suggestions. ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: ideas

  1. ideas

    Okay, I need some brain-power and I confess, more than I possess, if
    anyone wants a challenge; I'm not trying to get you to do my job for
    me, but I'm not afraid to admit I could use some suggestions.

    I have an inventory kit program and have to arrive at a price for a
    kit. Problem is, a kit may have kits within it; and in turn, those
    kits may have kits within them.

    So essentially, I need to somehow "explode" the main kit to be able to
    work with all the sub-kits, and sub-sub-kits, and
    sub-sub-sub-kits...and I'm not sure what the best way to do that would
    be.

    I thought of making a large array and if kit one had 3 parts and a kit
    in it, write out to the array, the 3 parts and the items in the
    sub-kit. Then, leave my index where it leaves off, and process the
    array - if I find a kit still exists after exploding the first
    sub-kit, add the items in that kit where I left off.

    Something like:

    KitA contains:
    Part 1
    Part 2
    Part 3
    KitB

    So my array would contain
    Part 1
    Part 2
    Part 3
    Kit B part 1
    Kit B part 2
    Kit B subkit Kit C

    Then, read the array again, if a sub-kit still exists, replace that
    sub-kit with the components of the kit

    Then the array would look like
    Part 1
    Part 2
    Part 3
    Kit B part 1
    Kit B part 2
    Kit C part 1
    Kit C part 2

    And keep repeating until no more kits??? Is there a better way?? I
    think there has to be...I would appreciate any ideas or suggestions.
    I am thinking I can't really do anything with a subroutine in RPG
    because it would end up calling itself??

    I hate things like this because you think about them even when you are
    not at work, or when you are trying to sleep - and counting kits is
    not more effective than counting sheep.

    Any and all ideas/suggestions are welcome.

    thanks,
    ga
    ga
    nospam@nospam.fmctc.com

  2. Re: ideas

    ga wrote:
    > Okay, I need some brain-power and I confess, more than I possess, if
    > anyone wants a challenge; I'm not trying to get you to do my job for
    > me, but I'm not afraid to admit I could use some suggestions.
    >
    > I have an inventory kit program and have to arrive at a price for a
    > kit. Problem is, a kit may have kits within it; and in turn, those
    > kits may have kits within them.
    >
    > So essentially, I need to somehow "explode" the main kit to be able to
    > work with all the sub-kits, and sub-sub-kits, and
    > sub-sub-sub-kits...and I'm not sure what the best way to do that would
    > be.
    >
    > I thought of making a large array and if kit one had 3 parts and a kit
    > in it, write out to the array, the 3 parts and the items in the
    > sub-kit. Then, leave my index where it leaves off, and process the
    > array - if I find a kit still exists after exploding the first
    > sub-kit, add the items in that kit where I left off.
    >
    > Something like:
    >
    > KitA contains:
    > Part 1
    > Part 2
    > Part 3
    > KitB
    >
    > So my array would contain
    > Part 1
    > Part 2
    > Part 3
    > Kit B part 1
    > Kit B part 2
    > Kit B subkit Kit C
    >
    > Then, read the array again, if a sub-kit still exists, replace that
    > sub-kit with the components of the kit
    >
    > Then the array would look like
    > Part 1
    > Part 2
    > Part 3
    > Kit B part 1
    > Kit B part 2
    > Kit C part 1
    > Kit C part 2
    >
    > And keep repeating until no more kits??? Is there a better way?? I
    > think there has to be...I would appreciate any ideas or suggestions.
    > I am thinking I can't really do anything with a subroutine in RPG
    > because it would end up calling itself??
    >
    > I hate things like this because you think about them even when you are
    > not at work, or when you are trying to sleep - and counting kits is
    > not more effective than counting sheep.
    >
    > Any and all ideas/suggestions are welcome.
    >


    This sounds like "bill of materials explosion". My RPG knowledge is
    limited at best, but google found this:
    http://www.ibmsystemsmag.com/i5/febr...ve/8096p1.aspx

    --
    Karl Hanson

  3. Re: ideas

    My first thought was recursion too.

    Have a program / procedure / module / subroutine (whatever you want to
    call it) that calculates the price of a kit. For each part in the kit
    add the price to the running total, for each subkit add the result of
    calling the program / procedure / module / subroutine again passing
    the subkit as the kit to price.

    I'm not an RPG guy, so I don't understand your comment about not being
    able to have a subroutine call itself, but Karl's link seems to show
    the way round that problem.

  4. Re: ideas

    ga wrote:
    > Okay, I need some brain-power and I confess, more than I possess, if
    > anyone wants a challenge; I'm not trying to get you to do my job for
    > me, but I'm not afraid to admit I could use some suggestions.
    >
    > I have an inventory kit program and have to arrive at a price for a
    > kit. Problem is, a kit may have kits within it; and in turn, those
    > kits may have kits within them.
    >
    > So essentially, I need to somehow "explode" the main kit to be able to
    > work with all the sub-kits, and sub-sub-kits, and
    > sub-sub-sub-kits...and I'm not sure what the best way to do that would
    > be.
    >
    > I thought of making a large array and if kit one had 3 parts and a kit
    > in it, write out to the array, the 3 parts and the items in the
    > sub-kit. Then, leave my index where it leaves off, and process the
    > array - if I find a kit still exists after exploding the first
    > sub-kit, add the items in that kit where I left off.
    >
    > Something like:
    >
    > KitA contains:
    > Part 1
    > Part 2
    > Part 3
    > KitB
    >
    > So my array would contain
    > Part 1
    > Part 2
    > Part 3
    > Kit B part 1
    > Kit B part 2
    > Kit B subkit Kit C
    >
    > Then, read the array again, if a sub-kit still exists, replace that
    > sub-kit with the components of the kit
    >
    > Then the array would look like
    > Part 1
    > Part 2
    > Part 3
    > Kit B part 1
    > Kit B part 2
    > Kit C part 1
    > Kit C part 2
    >
    > And keep repeating until no more kits??? Is there a better way?? I
    > think there has to be...I would appreciate any ideas or suggestions.
    > I am thinking I can't really do anything with a subroutine in RPG
    > because it would end up calling itself??
    >
    > I hate things like this because you think about them even when you are
    > not at work, or when you are trying to sleep - and counting kits is
    > not more effective than counting sheep.
    >
    > Any and all ideas/suggestions are welcome.


    This is standard bill of materials (BOM) explosion. Why would you be
    trying to write this yourself, instead of using the BOM capability that
    exists in any MRP software? Read up on MRP I (material requirements
    planning), MRP II (manufacturing resource planning), and enterprise
    resource planning (ERP). There are literally dozens of packages that do
    this.

  5. Re: ideas

    As others have said this is a standard bill of materials problem.

    The standard solution is an "involute" file structure that allows a
    single file to hold a tree of arbitrary depth.

    Recursion is a strait forward solution but loops can also be used.

    Mike




    "walker.l2" wrote in message
    news:b17a03c8-31ee-4809-9a75-19227d0bfded@8g2000hse.googlegroups.com...
    | My first thought was recursion too.
    |
    | Have a program / procedure / module / subroutine (whatever you want
    to
    | call it) that calculates the price of a kit. For each part in the
    kit
    | add the price to the running total, for each subkit add the result
    of
    | calling the program / procedure / module / subroutine again passing
    | the subkit as the kit to price.
    |
    | I'm not an RPG guy, so I don't understand your comment about not
    being
    | able to have a subroutine call itself, but Karl's link seems to show
    | the way round that problem.



  6. Re: ideas

    Jonathan Ball wrote:


    >This is standard bill of materials (BOM) explosion. Why would you be
    >trying to write this yourself, instead of using the BOM capability that
    >exists in any MRP software? Read up on MRP I (material requirements
    >planning), MRP II (manufacturing resource planning), and enterprise
    >resource planning (ERP). There are literally dozens of packages that do
    >this.


    Where did I say I was writing this myself (MRP software)??? The
    software this company runs was written in-house several years ago. I
    am doing some support work for them and they want a new twist on a
    pricing application, which involves the scenario I described. This is
    just one piece they would like changed in a very broad
    well-functioning set of application programs that they utilize.

    They are quite happy with their software and I have no reason to
    recommend moving to another application software. For the most part
    their software works flawlessly for them.

    I'm sorry if you feel my post requesting ideas was out of line, but
    sometimes we don't get to pick the deck; we have to play the cards we
    are dealt. Perhaps if they were starting from scratch I would
    recommend a different package to them, but they made that decision
    some time ago.

    Have a good day.
    ga
    ga
    nospam@nospam.fmctc.com

  7. Re: ideas

    Karl,

    Thanks for the reference to the article. I think it will be helpful.

    ga

    Karl Hanson wrote:

    >ga wrote:
    >> Okay, I need some brain-power and I confess, more than I possess, if
    >> anyone wants a challenge; I'm not trying to get you to do my job for
    >> me, but I'm not afraid to admit I could use some suggestions.
    >>
    >> I have an inventory kit program and have to arrive at a price for a
    >> kit. Problem is, a kit may have kits within it; and in turn, those
    >> kits may have kits within them.
    >>
    >> So essentially, I need to somehow "explode" the main kit to be able to
    >> work with all the sub-kits, and sub-sub-kits, and
    >> sub-sub-sub-kits...and I'm not sure what the best way to do that would
    >> be.
    >>
    >> I thought of making a large array and if kit one had 3 parts and a kit
    >> in it, write out to the array, the 3 parts and the items in the
    >> sub-kit. Then, leave my index where it leaves off, and process the
    >> array - if I find a kit still exists after exploding the first
    >> sub-kit, add the items in that kit where I left off.
    >>
    >> Something like:
    >>
    >> KitA contains:
    >> Part 1
    >> Part 2
    >> Part 3
    >> KitB
    >>
    >> So my array would contain
    >> Part 1
    >> Part 2
    >> Part 3
    >> Kit B part 1
    >> Kit B part 2
    >> Kit B subkit Kit C
    >>
    >> Then, read the array again, if a sub-kit still exists, replace that
    >> sub-kit with the components of the kit
    >>
    >> Then the array would look like
    >> Part 1
    >> Part 2
    >> Part 3
    >> Kit B part 1
    >> Kit B part 2
    >> Kit C part 1
    >> Kit C part 2
    >>
    >> And keep repeating until no more kits??? Is there a better way?? I
    >> think there has to be...I would appreciate any ideas or suggestions.
    >> I am thinking I can't really do anything with a subroutine in RPG
    >> because it would end up calling itself??
    >>
    >> I hate things like this because you think about them even when you are
    >> not at work, or when you are trying to sleep - and counting kits is
    >> not more effective than counting sheep.
    >>
    >> Any and all ideas/suggestions are welcome.
    >>

    >
    >This sounds like "bill of materials explosion". My RPG knowledge is
    >limited at best, but google found this:
    >http://www.ibmsystemsmag.com/i5/febr...ve/8096p1.aspx


    ga
    nospam@nospam.fmctc.com

  8. Re: ideas

    The SQL Recursive Common Table Expression support delivered in V5R4 is also a
    possibility. Bill of Materials explosion is one of the main reasons that SQL
    developers use this feature.

    ga wrote:
    > Jonathan Ball wrote:
    >
    >
    >> This is standard bill of materials (BOM) explosion. Why would you be
    >> trying to write this yourself, instead of using the BOM capability that
    >> exists in any MRP software? Read up on MRP I (material requirements
    >> planning), MRP II (manufacturing resource planning), and enterprise
    >> resource planning (ERP). There are literally dozens of packages that do
    >> this.

    >
    > Where did I say I was writing this myself (MRP software)??? The
    > software this company runs was written in-house several years ago. I
    > am doing some support work for them and they want a new twist on a
    > pricing application, which involves the scenario I described. This is
    > just one piece they would like changed in a very broad
    > well-functioning set of application programs that they utilize.
    >
    > They are quite happy with their software and I have no reason to
    > recommend moving to another application software. For the most part
    > their software works flawlessly for them.
    >
    > I'm sorry if you feel my post requesting ideas was out of line, but
    > sometimes we don't get to pick the deck; we have to play the cards we
    > are dealt. Perhaps if they were starting from scratch I would
    > recommend a different package to them, but they made that decision
    > some time ago.
    >
    > Have a good day.
    > ga
    > ga
    > nospam@nospam.fmctc.com


    --
    Kent Milligan
    ISV Enablement - System i
    kmill@us.eye-bee-m.com (spam trick) GO HAWKEYES!!
    >>> ibm.com/iseries/db2

    (opinions stated are not necessarily those of my employer)

+ Reply to Thread