QMF ne fournit pas la requête Q1 ou le format F1, mais l’exemple de programme utilise ces objets.
```cobol
DSQABFA TITLE 'SAMPLE QMF CALLABLE INTERFACE'
DSQABFA CSECT
DSQABFA AMODE 31
DSQABFA RMODE ANY
***********************************************************************
* *
* Sample Program: DSQABFA *
* Assembler Version of the QMF Callable Interface *
* *
***********************************************************************
SPACE 1
STM R14,R12,12(R13) SAVE ENTRY REGISTERS
BALR R12,0 INITIALIZE BASE REGISTER
USING *,R12
LA R2,SAVEAREA CHAIN SAVE AREAS
ST R2,8(R13)
ST R13,SAVEAREA+4
LR R13,R2 ESTABLISH SAVE AREA
SPACE 1
***********************************************************************
* Start a query interface session *
***********************************************************************
LA R4,CICOMM ESTABLISH ACCESS TO DSQCOMM
USING DSQCOMM,R4
SPACE 1
MVC DSQ_COMM_LEVEL,DSQ_CURRENT_COMM_LEVEL
LA R1,1 1 PARAMETER
ST R1,NUMPARMS
CALL DSQCIA,
(CICOMM, QI COMMON AREA
STARTQIL, START COMMAND LENGTH
STARTQI, START COMMAND
NUMPARMS, NUMBER OF KEYWORDS
STARTKYL, KEYWORD LENGTHS
STARTKY, KEYWORDS
STARTVL, VALUE LENGTHS
STARTV, VALUES
DSQ_VARIABLE_CHAR),VL VALUES ARE CHARACTERS
SPACE 1
***********************************************************************
* Set numeric values into query using SET command *
***********************************************************************
SPACE 1
LA R1,20 SET VALUES TO BE MODIFIED
ST R1,VVAL1
LA R1,40
ST R1,VVAL2
LA R1,84
ST R1,VVAL3
LA R1,3 3 PARAMETERS
ST R1,NUMPARMS
SPACE 1
CALL DSQCIA,
(CICOMM,
SETGL, SET GLOBAL COMMAND LENGTH
SETG, SET GLOBAL COMMAND
NUMPARMS, NUM OF VARIABLES TO BE SET
VNAME1L, VARIABLE NAME LENGTHS
VNAME1, VARIABLE NAMES
VVAL1L, VALUE LENGTHS
VVAL1, VALUES
DSQ_VARIABLE_FINT),VL VALUES ARE INTEGERS
SPACE 1
***********************************************************************
* Run a query *
***********************************************************************
SPACE 1
CALL DSQCIA,
(CICOMM,
QUERYL, QUERY COMMAND LENGTH
QUERY),VL TEXT OF QUERY COMMAND
SPACE 1
***********************************************************************
* Print the result of the query *
***********************************************************************
SPACE 1
CALL DSQCIA,(CICOMM,REPTL,REPT),VL
SPACE 1
***********************************************************************
* End the query interface session *
***********************************************************************
SPACE 1
CALL DSQCIA,(CICOMM,ENDQIL,ENDQI),VL
SPACE 1
***********************************************************************
* Return *
***********************************************************************
SPACE 1
SR R15,R15 SET RETURN CODE
L R13,4(R13)
L R14,12(R13) RESTORE CALLER REGISTERS
LM R0,R12,20(R13)
BR R14
EJECT
***********************************************************************
* Data Areas *
***********************************************************************
SPACE 1
* Query Interface commands
SPACE 1
STARTQI DC C'START' START FUNCTION
SETG DC C'SET GLOBAL' SET GLOBAL FUNCTION
QUERY DC C'RUN QUERY Q1' RUN QUERY
REPT DC C'PRINT REPORT (FORM=F1)' PRINT REPORT
ENDQI DC C'EXIT' END INTERFACE
SPACE 1
DS 0F
STARTQIL DC AL4(L'STARTQI) LENGTH OF START FUNCTION
SETGL DC AL4(L'SETG) LENGTH OF SET GLOBAL FUNCTION
QUERYL DC AL4(L'QUERY) LENGTH OF RUN QUERY COMMAND
REPTL DC AL4(L'REPT) LENGTH OF PRINT REPORT COMMAND
ENDQIL DC AL4(L'ENDQI) LENGTH OF END INTERFACE COMMAND
SPACE 1
* START command keyword
SPACE 1
STARTKY DC C'DSQSMODE'
STARTV DC C'INTERACTIVE'
DS 0F
STARTKYL DC AL4(L'STARTKY)
STARTVL DC AL4(L'STARTV)
SPACE 1
* SET GLOBAL command variable names
SPACE 1
VNAME1 DC C'MYVAR01'
VNAME2 DC C'SHORT'
VNAME3 DC C'MYVAR03'
DS 0F
VNAME1L DC AL4(L'VNAME1)
VNAME2L DC AL4(L'VNAME2)
VNAME3L DC AL4(L'VNAME3)
SPACE 1
* SET GLOBAL command values
SPACE 1
VVAL1 DS F
VVAL2 DS F
VVAL3 DS F
VVAL1L DC AL4(L'VVAL1)
VVAL2L DC AL4(L'VVAL2)
VVAL3L DC AL4(L'VVAL3)
SPACE 1
NUMPARMS DS F NUMBER OF KEYWORDS
SPACE 1
* Callable interface communications area
SPACE 1
CICOMM DS CL(DSQCOMM_LEN)
SPACE 1
SAVEAREA DS 18F
EJECT
DSQCOMMA
SPACE 1
R0 EQU 00 EQUATES FOR REGISTERS 0-15
R1 EQU 01
R2 EQU 02
R3 EQU 03
R4 EQU 04
R5 EQU 05
R6 EQU 06
R7 EQU 07
R8 EQU 08
R9 EQU 09
R10 EQU 10
R11 EQU 11
R12 EQU 12
R13 EQU 13
R14 EQU 14
R15 EQU 15
SPACE 1
END DSQABFA