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


  • Subject: RE: passsing parameters to query/400
  • From: janusz.prusaczyk@xxxxxx
  • Date: Thu, 13 Jan 2000 20:06:44 +0100

Hi,

I understand that you would like to have a command which would start query
with a parameter, so RUNQRY with RCDSLT(*YES) wouldn't do...

I did it like this:
I wrote a QMQRY which used parameters, eg.

SELECT R36AS1, R36PAC, R36DTA, R36TIM, R36AMT, R36AS2 
FROM RMLIB/RMF36P                                     
WHERE R36AS1=&NAZMASZ AND R36DTA>&DATPOCZ             

and compiled it:

QSYS/CRTQMQRY QMQRY(DAVID/MO_IN) SRCFILE(DAVID/SOURCES) SRCMBR(MO_IN) 

Then I wrote a CLPGM running that QRY:

PGM        PARM(&NAZ &DAT &WYJ)                        
DCL        VAR(&NAZ) TYPE(*CHAR) LEN(10)               
DCL        VAR(&DAT) TYPE(*CHAR) LEN(8)                
DCL        VAR(&WYJ) TYPE(*CHAR) LEN(10) VALUE(*PRINT) 
DCL        VAR(&NAZ2) TYPE(*CHAR) LEN(12)              
CHGVAR     VAR(&NAZ2) VALUE('''' *TCAT &NAZ *TCAT +    
             '''')                                     
STRQMQRY   QMQRY(DAVID/MO_IN) OUTPUT(&WYJ) +           
             QMFORM(*SYSDFT) SETVAR((NAZMASZ +         
             &NAZ2) (DATPOCZ &DAT))                    
ENDPGM                                                 

Then I wrote a command calling that program:

CMD        PROMPT('Super quera Dawida Prusaczyka')        
PARM       KWD(NAZMASZ) TYPE(*CHAR) LEN(10) RSTD(*NO) +   
             MIN(1) ALWUNPRT(*NO) PROMPT('Nazwa +         
             maszyny wys. paczke')                        
PARM       KWD(DATA) TYPE(*CHAR) LEN(8) MIN(1) +          
             ALWUNPRT(*NO) PROMPT('Data odebrania paczki')
PARM       KWD(WYJ) TYPE(*CHAR) RSTD(*YES) DFT(*PRINT) +  
             VALUES(* *PRINT) PROMPT('Jaki chcesz +       
             output?')                                    

Now you have a command which you can use as any other command...

Of course, to run query from CLPGM you don't need any command - but having
it you can not forget compulsory parameters, you don't have to think where
to put apostrophes and should you use capital letters? And you can use
default values for parameters...

I don't know how to pass footers or headers as parameters...

Regards,
  *********************************************
  * Dawid Janusz Prusaczyk                    *
  * Janusz.Prusaczyk@BIG.pl                   *
  * tel. +48 (22) 657 57 48                   *
  *********************************************

  "Experience is what you get when you didn't get what you wanted"

-----Original Message-----
From: nan pat [mailto:seedrp@hotmail.com]
Sent: Wednesday, January 12, 2000 7:28 AM
To: MIDRANGE-L@midrange.com
Subject: passsing parameters to query/400



Hi every body,

can any body tell me if there is any way ( I really wonder !!!) by which we 
can pass parameters to the querry/400.
(...)
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.