× 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: Find number of parms for a CL or pas
  • From: Glenn Gundermann <ggundermann@xxxxxxx>
  • Date: Thu, 12 Jun 1997 16:18:19 GMT

David,

Here's another attempt to answer this.  It's what I use as a front-end.
It's interactive for us so we could use record selection.  You could either
modify it and put in batch if no record selection is needed or have a
different command altogether.  It has a bunch of stuff you probably don't
need but here it is as is.

===============
CMD - RUNQRYOVR (source is in QGPL/QCMDSRC, souce member UT5010, compiled
with                 cpp of UT5010C.
===============

        CMD     PROMPT('Run Query with Override')

        PARM    KWD(QRY) TYPE(QUAL1) MIN(1) PROMPT('Query')
QUAL1:  QUAL    TYPE(*NAME) LEN(10)
        QUAL    TYPE(*NAME) LEN(10) DFT(*LIBL) SPCVAL(*LIBL) PROMPT('Library')

        PARM    KWD(RCDSLT) TYPE(*CHAR) LEN(4) RSTD(*YES) DFT(*NO) +
                  VALUES(*NO *YES) PROMPT('Record selection')

        PARM    KWD(OUTQ) TYPE(QUAL2) DFT(*SAME) SNGVAL((*SAME)) +
                  PROMPT('Output queue')
QUAL2:  QUAL    TYPE(*NAME) LEN(10)
        QUAL    TYPE(*NAME) LEN(10) DFT(*LIBL) SPCVAL((*LIBL)) PROMPT('Library')

        PARM    KWD(CPI) TYPE(*CHAR) LEN(5) RSTD(*YES) DFT(*SAME) +
                  VALUES(*SAME 5 10 12 13.3 15 16.7 18 20) +
                  PROMPT('Characters per inch')

        PARM    KWD(DRAWER) TYPE(*CHAR) LEN(5) RSTD(*YE) DFT(*SAME)+
VALUES(*SAME 1 2 3 4 *E1) PROMPT('Drawer)

        PARM    KWD(COPIES) TYPE(*DEC) LEN(3 0) DFT(*SAME) RANGE(1 255)+
SPCVAL((*SAME -1)) PROMPT('Copies')

        PARM    KWD(HOLD) TYPE(*CHAR) LEN(5) RSTD(*YES) DFT(*SAME) +
                  VALUES(*SAME *NO *YES) PROMPT('Hold')

        PARM    KWD(SAVE) TYPE(*CHAR) LEN(5) RSTD(*YES) DFT(*SAME) +
                  VALUES(*SAME *NO *YES) PROMPT('Save')

        PARM    KWD(PAGRTT) TYPE(*CHAR) LEN(5) RSTD(*YES) DFT(*SAME)+
VALUES(*SAME *AUTO *DEVD *COR 0 90 180 270) +
                  PROMPT('Degree of page rotation')

=============
CPP - UT5010C
=============

        PGM     PARM(&FULLQRY &RCDSLT &FULLOUTQ &CPI &DRAWER +
                  &COPIES &HOLD &SAVE &PAGRTT)

        DCL     VAR(&FULLQRY)   TYPE(*CHAR) LEN(20)
        DCL     VAR(&RCDSLT)    TYPE(*CHAR) LEN(4)
        DCL     VAR(&FULLOUTQ)  TYPE(*CHAR) LEN(20)
        DCL     VAR(&CPI)       TYPE(*CHAR) LEN(5)
        DCL     VAR(&DRAWER)    TYPE(*CHAR) LEN(5)
        DCL     VAR(&COPIES)    TYPE(*DEC)  LEN(3 0)
        DCL     VAR(&HOLD)      TYPE(*CHAR) LEN(5)
        DCL     VAR(&SAVE)      TYPE(*CHAR) LEN(5)
        DCL     VAR(&PAGRTT)    TYPE(*CHAR) LEN(5)

        DCL     VAR(&QRY)       TYPE(*CHAR) LEN(10)
        DCL     VAR(&QRYL)      TYPE(*CHAR) LEN(10)
        DCL     VAR(&OUTQ)      TYPE(*CHAR) LEN(10)
        DCL     VAR(&OUTQL)     TYPE(*CHAR) LEN(10)
        DCL     VAR(&COPIESC)   TYPE(*CHAR) LEN(3)
        DCL     VAR(&OVRPRTF)   TYPE(*CHAR) LEN(150) +
                  VALUE('OVRPRTF FILE(QPQUPRFIL)')

        DCL     VAR(&ERRORSW)   TYPE(*LGL)
        DCL     VAR(&MSGID)     TYPE(*CHAR) LEN(7)
        DCL     VAR(&MSGDTA)    TYPE(*CHAR) LEN(100)
        DCL     VAR(&MSGF)      TYPE(*CHAR) LEN(10)
        DCL     VAR(&MSGFLIB)   TYPE(*CHAR) LEN(10)
        DCL     VAR(&KEYVAR)    TYPE(*CHAR) LEN(4)

        MONMSG  MSGID(CPF0000) EXEC(GOTO STDERR1)

        CHGVAR  VAR(&QRY)       VALUE(%SST(&FULLQRY   1 10))
        CHGVAR  VAR(&QRYL)      VALUE(%SST(&FULLQRY  11 10))
        CHGVAR  VAR(&OUTQ)      VALUE(%SST(&FULLOUTQ  1 10))
        CHGVAR  VAR(&OUTQL)     VALUE(%SST(&FULLOUTQ 11 10))

        CHKOBJ  OBJ(&QRYL/QRY) OBJTYPE(*QRYDFN)

        IF      COND(&CPI *NE *SAME) THEN(DO)
        CHGVAR  VAR(&OVRPRTF) VALUE(&OVRPRTF *BCAT 'CPI(' *CAT &CPI *TCAT ')')
        ENDDO

        IF      COND(&OUTQ *NE *SAME) THEN(DO)
        CHGVAR  VAR(&OVRPRTF) VALUE(&OVRPRTF *BCAT 'OUTQ(' *CAT &OUTQL *TCAT +
                  '/' *CAT &OUTQ *TCAT ')')
        ENDDO

        IF      COND(&DRAWER *NE *SAME) THEN(DO)
        CHGVAR  VAR(&OVRPRTF) VALUE(&OVRPRTF *BCAT 'DRAWER(' *CAT &DRAWER +
                  *TCAT ')')
        ENDDO

        IF      COND(&COPIES *NE -1) THEN(DO)
        CHGVAR  VAR(&COPIESC) VALUE(&COPIES)
        CHGVAR  VAR(&OVRPRTF) VALUE(&OVRPRTF *BCAT 'COPIES(' *CAT &COPIESC +
                  *TCAT ')')
        ENDDO

        IF      COND(&HOLD *NE *SAME) THEN(DO)
        CHGVAR  VAR(&OVRPRTF) VALUE(&OVRPRTF *BCAT 'HOLD(' *CAT &HOLD *TCAT +
                  ')')
        ENDDO

        IF      COND(&SAVE *NE *SAME) THEN(DO)
        CHGVAR  VAR(&OVRPRTF) VALUE(&OVRPRTF *BCAT 'SAVE(' *CAT &SAVE *TCAT +
                  ')')
        ENDDO

        IF      COND(&PAGRTT *NE *SAME) THEN(DO)
        CHGVAR  VAR(&OVRPRTF) VALUE(&OVRPRTF *BCAT 'PAGRTT(' *CAT &PAGRTT +
                  *TCAT ')')
        ENDDO

        CHGVAR  VAR(&OVRPRTF) VALUE(&OVRPRTF *BCAT 'SPLFNAME(' *CAT &QRY +
                  *TCAT ')')

        CALL    PGM(QCMDEXC) PARM(&OVRPRTF 150)

        RUNQRY  QRY(&QRYL/&QRY) RCDSLT(&RCDSLT)

        RETURN

STDERR1: IF     COND(&ERRORSW) THEN(SNDPGMMSG MSGID(CPF9999) MSGF(QCPFMSG) +
MSGTYPE(*ESCAPE))
        CHGVAR  VAR(&ERRORSW) VALUE('1')

STDERR2: RCVMSG MSGTYPE(*DIAG) RMV(*NO) KEYVAR(&KEYVAR) MSGDTA(&MSGDTA) +
MSGID(&MSGID) MSGF(&MSGF) SNDMSGFLIB(&MSGFLIB)
        IF      COND(&KEYVAR *EQ ' ') THEN(GOTO CMDLBL(STDERR3))
        RMVMSG  MSGKEY(&KEYVAR)
        SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) MSGDTA(&MSGDTA) +
                    MSGTYPE(*DIAG)
        GOTO    CMDLBL(STDERR2)

STDERR3: RCVMSG MSGTYPE(*EXCP) MSGDTA(&MSGDTA) MSGID(&MSGID) MSGF(&MSGF) +
                  SNDMSGFLIB(&MSGFLIB)
        SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) MSGDTA(&MSGDTA) +
                  MSGTYPE(*ESCAPE)
        ENDPGM

At 06:52 PM 6/11/97 -0500, David Gibbs wrote:
>At 09:30 PM 6/11/97 GMT, Glenn Gundermann wrote:
>>Not sure if I understand the question....
>>OVRPRTF QPQUPRFIL SPLFNAME(&query-name)
>>RUNQRY QRY(&query-name) ......
>>will substitute the query name for the usual spooled file name of QPQUPRFIL.
>
>Yes, this I understand... but I want to write a FRONT END for RUNQRY so
>that the spool file generated is the name of the query instead of QPQUPRFIL.

    _/_/_/_/   _/         _/_/_/_/   _/_/    _/   _/_/    _/
   _/         _/         _/         _/ _/   _/   _/ _/   _/
  _/  _/_/   _/         _/_/_/     _/  _/  _/   _/  _/  _/
 _/    _/   _/         _/         _/   _/ _/   _/   _/ _/
_/_/_/_/   _/_/_/_/   _/_/_/_/   _/    _/_/   _/    _/_/

Glenn Gundermann
ggundermann@ibm.net
work tel: (416) 967-8222
cel:      (416) 409-4551

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the Midrange System Mailing List!  To submit a new message,   *
* send your mail to "MIDRANGE-L@midrange.com".  To unsubscribe from     *
* this list send email to MAJORDOMO@midrange.com and specify            *
* 'unsubscribe MIDRANGE-L' in the body of your message.  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.