× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Sorry for the long post Vern, but you asked for it!

So far my 'workaround' ain't workin', but I'll get there

The programs involved are ProGen Plus generated. It's an inquiry
application where the user:

1) starts with a customer subfile inquiry full screen

2) An SFL option drills down to display sales for that customer in a window,
one line/month

3) An SFL option in this window drills down to display sales by item for
that customer for that month in another window, one line/item

4) An SFL option in THIS window drills down to display detail sales by item
for that customer for that month in yet another window, one
line/item/invoice for that month

It's this last program in the bunch with the issue. The invoice date
(INVDT) in the file is *ISO. Progen Plus has built in that you can set key
fields to *LIMIT which means the user cannot enter the key and the only
records from the file that will be displayed must match those key(s).
Progen Plus handles this so I don't have to worry about it. I wanted to
restrict it to that year/month. Since there is only a date field, INVDT, in
the file, I created a LF via DDS like this (I removed some of the fields as
they're irrelevant to the discussion):

A*
A* Record format of sales history
A*
A R SHRECORD PFILE(*LIBL/SLSHST)
A TEXT('Sales History by +
A Customer/Item/Date')
A CUSNR
A INVDT A
A ITNBR
A ITNSA
A QTYSH
.
.
.
.
.
A CMCST
A INVYR I SST(INVDT 1 4)
A INVMO I SST(INVDT 5 2)
A INVDY I SST(INVDT 7 2)
A*
A* Key for this logical view
A*
A K CUSNR
A K ITNBR
A K INVYR DESCEND
A K INVMO DESCEND
A K INVDY DESCEND

Note that I redefined INVDT as character, then substringed it to create 3
separate fields (year, month, day) that I used as descending keys. By doing
this and telling Progen that CUSNR, ITNBR, INVYR, and INVMO were *LIMIT key
fields, I didn't have to worry about it. Progen handled it all and the user
could not get outside of that customer/item/year/month. But I can't
recreate that LF via SQL.

Since this is the only program that uses that LF, I had actually decided to
try to eliminate it anyway, thinking it a waste. (The table has 500,000+
records and I already have another index keyed on CUSNR, ITNBR, INVDT desc.
I asked the question though, for my own learning. I was actually rather
surprised something like this could be done via DDS, but not DDL. I just
assumed I was not finding examples.

I talked to BCD Progen support (some of the best around) and we'll be able
to get the results I want via my programming limiting the records that can
be seen. We just haven't figured out the details yet.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.