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



Jim,

I would like to accomplish the same thing, but it cannot be accomplished
inside of the *QMFORM object when the SQL result set has no records.  The
variables available for header, footer, break all come from a column in the
result set.

I normally show the selection criteria as part of the header as follows:
 SELECT
     ALL       A.STATEID, A.SSN, A.DSPCDE, '&libname', '&gen_id'
     FROM      AWXTEST/PCCOMPARE as A Exception JOIN
               &LIBNAME/MEXMASP as B
               ON A.SSN = B.AMSSN
     WHERE     A.STATEID = &GEN_ID

In the *QMFORM I reference columns &4 and &5 like this:
     Line  Align     Page Heading Text
        1  Left      Library: &4  Gen_ID: &5

In the Edit Column Formatting section
        Column    Heading              Usage
      4                              omit
      5                              omit

This works great except when no records are selected.  In that case the
report comes up empty including the value of &4 and &5.

To get around that problem, you can substring the variables (up to 30
characters) in something like this:
Dcl   VAR(&PrtText) TYPE(*CHAR) LEN(30)
Chgvar &PrtText 'Lib: ' || &Lib || ' Gen_ID: ' || &Gen_ID)
OVRPRTF PRTTEXT(&PrtText)

The print text will appear on bottom of report even when the report is
empty.

Hope this helps.  Feel free to contact me off line for more info.

Don Tully
Tully Consulting LLC
920 996-0448

-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of Jim Essinger
Sent: Wednesday, December 22, 2004 1:27 PM
To: Midrange Systems Technical Discussion
Subject: RE: QMQRYFORM and variables


   Don,

   I'm not sure I'm clear on what you are telling me.  I know that I can
(and
   I do) override the printer file so that the report goes to the printer I
   want with the number of copies I need, and some unique user data.

   When I pass a variable to the qmqry, it uses it to compare in a where, or
   to point to a library in a from statement.  I can't use that data in the
   header in some fashion?  I already pass the name of the library to the
   query so that query looks like;

   SELECT
     ALL       A.STATEID, A.SSN, A.DSPCDE
     FROM      AWXTEST/PCCOMPARE as A Exception JOIN
               &LIBNAME/MEXMASP as B
               ON A.SSN = B.AMSSN
     WHERE     A.STATEID = &GEN_ID

   I can't use the &LIBNAME variable in the header, footer,  or some other
   part of the report in the form, to indicate what library the query was
run
   against?

   Thanks for your response!

   Jim

   At 05:27 PM 12/21/2004, you wrote:

     You could preceed the qry with OVRPRTF PRTTXT(... library).  Otherwise
     all
     external data to QMQRYFORM comes from field data in the record set.
     Since
     the record set is empty, no way for QMQRYFORM to use it.

     Don Tully
     Tully Consulting LLC

     -----Original Message-----
     From: midrange-l-bounces@xxxxxxxxxxxx
     [ mailto:midrange-l-bounces@xxxxxxxxxxxx]On Behalf Of Jim Essinger
     Sent: Tuesday, December 21, 2004 6:28 PM
     To: midrange-l@xxxxxxxxxxxx
     Subject: QMQRYFORM and variables

     I have looked for a couple of hours, and can't see that it is
     possible.  Can one put variables in the headers for a qmqry?  I have a
     query I want to run multiple times, and over the same files in
different
     libraries.  If the query comes back blank, I would like to know the
     library
     it was pointed to, and so want to put the library name in the heading
of
     the query.  The footing would be ok too, just on the page so there is
     some
     link to the library name that I passed into the query.

     Oh great and knowledgeable guru's - have you any good news for me?

     And - Happy Holidays to you all!!

     Jim Essinger
     Senior Programmer/Analyst
     Student Loan Fund of Idaho
     PO Box 730
     Fruitland ID 83619
     208-452-4058
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.


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.