variable length variable in a deferred DQ PROC

Document ID : KB000103921
Last Modified Date : 13/07/2018
Show Technical Document Details
Introduction:
In CA Dataquery DQRY, I am trying to use the #DQOPERATORNAME variable in a Deferred query.

I need some way to uniquely identify each EXPORTed DSN to a user.

How do I pass a variable length variable via DQ PROC? 

Refer to CA Datacom Core - 15.1 section on CA Dataquery  "Batch Online Management: "Important Concepts" 
https://docops.ca.com/ca-datacom/15-1/en/administrating/administrating-ca-dataquery/batch-management-overview/batch-online-management
"... 
Commas in JCL 

If a JCL variable ends with a comma, the variable must be on the end of the line because a blank is required to indicate the end of the variable. 
..." 

But, if I place a space at the end of the variable, it will add the blank to DSN node, causing JCL error IEFC605I.

This is the Dataquery PROC:
.. ================================ T O P =====================================
01 //TP1DQFBF JOB (999,APP4),'P1 NEW DQRY FB FILE ', 
02 // CLASS=X,MSGCLASS=R,NOTIFY=&SYSUID 
03 //STEP01 EXEC DQBATCH 
04 //DQFIXD DD DSN=HLQ.A1?****** .DQRYFB.2?********, 
05 // DISP=(NEW,CATLG,DELETE), 
06 // SPACE=(CYL,(1,1)),UNIT=SYSDA 
07 //SYSIN DD * 
08 /* DQ INPUT 
09 // 
.. =========================== B O T T O M ==================================


After adding the blank, note the JCL errors from the execution:
XX*===================================================================
19 //DQFIXD DD DSN=HLQ.A041194 .DQRYFB.MYTEST02, 
20 // DISP=(NEW,CATLG,DELETE), 
21 // SPACE=(CYL,(1,1)),UNIT=SYSDA 
22 //SYSIN DD * 
23 // 
O. MESSAGE 
2 IEFC001I PROCEDURE DQBATCH WAS EXPANDED USING SYSTEM LIBRARY …
20 IEFC605I UNIDENTIFIED OPERATION FIELD 
21 IEFC605I UNIDENTIFIED OPERATION FIELD

 
Question:
How to define a variable length variable in a deferred DQ PROC?
 
Environment:
z/OS 
CICS
Answer:
Since the blank will cause a JCL error in this case, use JCL SET statements to assign the values instead:

Modified DQ PROC using JCL SET statements: 

//TP1DQFBF JOB (999,APP4),'P1 NEW DQRY FB FILE ', 
// CLASS=X,MSGCLASS=R,NOTIFY=&SYSUID 

// SET MYUID=A1?****** 
// SET MYFILE=2?******** 

//STEP01 EXEC DQBATCH 
//DQFIXD DD DSN=HLQ.&MYUID..DQRYFB.&MYFILE.,
// DISP=(NEW,CATLG,DELETE), 
// SPACE=(CYL,(1,1)),UNIT=SYSDA 
//SYSIN DD * 
/* DQ INPUT 
// 
Additional Information: