STRQMQRY in batch on i5

35 pts.
Tags:
CL
SQL
SQL development
STRQMQRY
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

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:

<pre>
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
</pre>

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:
<pre>
STRQMQRY QMQRY(PUR1212Q) OUTPUT(*OUTFILE) +
OUTFILE(QTEMP/UR129W) SETVAR((‘Start’ +
&STRDATE) (‘End’ &ENDDATE))
</pre>
I assume that &Start and &End are both numeric in the query?

Tom

That worked, Tom. Thanks

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following