Return codes for QRYSIZE

If the length specified in QRYSIZE is not big enough to contain the complete result, the program returns a return code of 7622 (RQST_FCQUERY_QRYINFO_TOO_SMALL). The program places the total space required in the reason code. The truncated data is in the QRYINFO data area; however, RESULTX will be empty.

If the length specified in QRYSIZE is big enough to contain the complete result, the program returns a return code of 7623 (RQST_FCQUERY_QRYINFO_LARGE_ENOUGH). The program places the total amount of space that the result uses in the reason code part of RETINFO.

The return code is included in message ANTR8811E, which is returned in the RESULT variable.

Figure 1 shows how an exec might check the RESULT variable for the return code.

Figure 1. Example of Using the Return Code for QRYSIZE
... 

call anttrexx 'FCQUERY'	, 'INOUT'

/* save the result variable */ 
presult = result                                                      

/* check for the error message ANTR8811E ERROR: request RETURN_CODE return_code  */
	parse var presult resulta resultb resultc resultd resulte resultrest  
	if resulta = 'ANTR8811E' then
	    do
          /* check for too-small return code */ 
          if resulte = 7622 then
	            do
	                say 'QRYSIZE TOO SMALL, RESULTS TRUNCATED.'  
	            end                                                     

 ...