| www.5-10.com | Run Query Abbreviated |
You can use query to display a file, as easy as typing the following command:
RUNQRY () FILE RCDSLT(*YES)
I changed PDM to run this command as follows:
RQ RUNQRY () &L/&N RCDSLT(*yes)
This will show all fields in the file. I use this command a lot as a debugging tool, so I creates an abbreviated command. I now type in the following:
RQ FILE
To accomplish the same thing. The RCDSLT(*YES), allows you to put in criteria to select. Just press enter, if you want to see all records. The RCDSLT screen pops up so fast, I use to see the files layout.
Here is the source code to the RQ command:
----- QCMDSRC/QGPL(RQ)--------------------
CMD PROMPT('Run Query Abbreviated')
PARM KWD(FILE) TYPE(*CHAR) LEN(10) MIN(1) +
PROMPT('File')
PARM KWD(LIB) TYPE(*CHAR) LEN(10) DFT(*LIBL) +
SPCVAL((*LIBL)) PROMPT('Library')
PARM KWD(MBR) TYPE(*CHAR) LEN(10) DFT(*FIRST) +
SPCVAL((*FIRST)) PROMPT('Member')
----- QCLSRC/QGPL(RQ)-------------------- PGM (&file &lib &mbr) DCL VAR(&FILE) TYPE(*CHAR) LEN(10) DCL VAR(&LIB ) TYPE(*CHAR) LEN(10) DCL VAR(&MBR ) TYPE(*CHAR) LEN(10) RUNQRY QRYFILE((&LIB/&FILE &MBR)) RCDSLT(*YES) ENDPGM