STRQMQRY in batch on i5
35 pts.
0
Q:
STRQMQRY in batch on i5
Can STRQMQRY be run in batch? I am getting error message: Global variable prompting is not allowed in batch mode. I am passing 2 parameters from a display screen

Software/Hardware used:
iSeries, SQL, CL
ASKED: Oct 19 2009  4:16 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
35 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Yes it can run in Batch mode, you can use the DSPCMD STRQMQRY to view where allowed to run.
Here is a good link to view on this subject:
http://archive.midrange.com/midrange-l/200302/msg00860.html

ok, I think I am missing quotes around my char variables, here is my code:


Pgm Parm(&Strdate &Enddate)

DcL &Strdate *Char 8
Dcl &Enddate *Char 8
DcL &FTPSession *Char 10 'PUTIAITTST'
Dcl &RemoteFile *Char 64
Dcl &LocalFile *Char 64 'UR129W'
Dcl &Lib *Char 10 *Libl
Dcl &Member *Char 10 *First
Dcl &Result *Char 1
Dcl &Date *Char 6
Dcl &Time *Char 6
STRQMQRY QMQRY(PUR1212Q) OUTPUT(*OUTFILE) +
OUTFILE(QTEMP/UR129W) SETVAR((START +
&STRDATE) (END &ENDDATE))


TXT code:

Select CONID

From mylib/DENTAL
Where
P_INVDAT >= &Start AND P_INVDAT <= &End


Can anyone help? Thanks

================================================================

The query is using substitution variables named &Start and &End, but you're passing in variables with different names -- START and END. QM substitution variable names are case sensitive. Try this:

STRQMQRY QMQRY(PUR1212Q) OUTPUT(*OUTFILE) +
OUTFILE(QTEMP/UR129W) SETVAR(('Start' +
&STRDATE) ('End' &ENDDATE))

I assume that &Start and &End are both numeric in the query?

Tom




That worked, Tom. Thanks
Last Answered: Oct 20 2009  1:36 PM GMT by TOASTY   35 pts.
Latest Contributors: TomLiotta   8025 pts., Whatis23   4040 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



0