REGISTER or login:
Thanks for all of the posts...
I have created a CL program to run the queries. One query, as suggested, creates a temporary file to be checked for the existence of records. The other query will print the report (if records exist in the temporary file).
I guess I have an issue with the CL programming. It prints the report even if the temporary file has no records. Here is the code I am using:
DSPFD FILE(PRODLIB/TEMPF) TYPE(*MBR) OUTPUT(*OUTFILE) +
OVRDBF FILE(QAFDMBR) TOFILE(QTEMP/QAFDMBR) POSITION(*START)
IF COND(&MBNRCD *GT 0) RUNQRY QRY(MYLIB/REPORTQRY)
Your If structure won't work ..If then ... as below.
The way it's coded if it's true do noting.
Then in all cases run the query.
I think you will find that the RVMBRD is more effective.
DCL &RCDCNT TYPE(*DEC) LEN(10 0)
RTVMBRD FILE(PRODLIB/TEMPF) NBRCURRCD(&RCDCNT)
IF COND(&RCDCNT *GT 0) +