4、CL programming (二)
一、Passing parameter in CL
Ü PASSING THE PARAMETER IN CL
PGM(CTO04R00)
二、QCMDEXC API
Ü QCMDEXC
· This is an API to execute command from HLL.
· We can change the command at run time.
· The commands that are only used in CL programare not permissible here.
· Below is the process on how to use this API.
D CMD S 1 DIM(75) CTDATA PERRCD(75) D CMDLEN S 15 5 C EVAL CMDLEN = %LEN(%TRIM(CMD)) C* Execute Command using QCMDEXC C CALL 'QCMDEXC' C PARM CMD C PARM CMDLEN |
Example
OUTPUT
Dataqueue DTAQ000 is deleted from IROBO1.
三、Example-SNDF,RCVF,SNDRCVF
Ü To read from the database file and then writeit on the screen.
Below is the display file that hasbeen used in the program:
***NOTE: We can use SNDRCVFinstead of SNDF and RCVF.
SNDRCVF is used onlyfor display file.
OUTPUT
We press ENTER to get the screen below:
四、Example RCVF
ÜCL program toread a database file and display its field’s value on the console & promptevery time before reading a new record from the file
Ø Physical file used in theprogram = CUST
Ø CL Program
OUTPUT
Below is the output that we get on the console.