× 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.



>(Buck Calabro responded:) Without a key to tie the
record back to the database ...
--------------------

There can be many ways the key info is passed back to
the calling program: LDA would be one example. When
the user selects 1 line from the subfile, the pgm just
has to return back the entire line via the LDA at some
fixed positions to the calling pgm. The important
point here is  the calling program knows which file &
keys fields are being involved and thus knows how to
work back the record to be selected. The pgm can even
return the RRN if need be.
Say you have this requirement: Allow the user to
select a batch header for some application. You can
call the generic pgm (call it GENPGM),even passing the
entire SQl statement as a parm. Then GENPGM displays
all detail lines related to the batch header and waits
for the user to select a line. The user then types an
appropriate option (e.g 1:Select 4:Delete etc..). Then
GENPGM writes the whole line to LDA at some 'standard'
position (assuming it contains the key field(s)) plus
the option typed in. That's all of GENPGM's job :
display the file, handle the page scrolling, accept
user input, pass back the record key or RRN and the
option typed in to the calling pgm. The calling pgm
now processes the LDA to get back the key and then
displays the record for maintenance or whatever.
I have already written something resembling this
generic program that proved quite useful to me a
handful number of times. Just had to call it without
having to program the subfile display again. It is
very far from perfect though. The biggest hurdle,
which I have not solved yet, is the handling of
displaying digits   (grin) , there's no SQL in-built
function that could convert it to a string  but with
the appropriate editing (double grin!). e,g if I pass
as a parameter 'select invnum || digits(amount) ||
custno from FILE into YLINE', I can get something like
'INV1234  000120900  CUSTOMERX' as output instead of a
prettier 'INV1234  1209.00  CUSTOMERX'
(If anyone knows how to circumvent this...)

Thank you for the lead on David Morris article.  I
only hoped not having to resort to SQLDA though ...

Regards


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.