From: Dennis Detwiler To: All
I'm doing an OPNQRYF to limit access to certain records. The CL program works; but when a subfile is displayed, it includes records that I was trying to eliminate. Is this something peculiar to subfiles? This file contains records organized by Officer. I'm comparing the user ID to a cross-reference file to get the initials and then doing an OPNQRYF for those initials compared to the field in the file I'm accessing.
From: Ted Holt To: Dennis Detwiler
If you're getting records you don't intend to get, first make sure that the input file has the SHARE(*YES) attribute (see 6). People usually do this by overriding the database file before calling the high-level language (HLL) program.
If you're getting records you don't intend to get, first make sure that the input file has the SHARE(*YES) attribute (see Figure 6). People usually do this by overriding the database file before calling the high-level language (HLL) program.
If file XYZ is not shared, HLLPGM will not read the OPNQRYF file, but will read the file directly.
If that's OK, the next thing I would check for is errors in logical operators-*AND, *OR, *NOT. Are you using any of them in the QRYSLT parameter?
I would also check for errors with concatenation operators. For example, using *BCAT when you really need *CAT can make OPNQRYF retrieve the wrong records.
Check these things out. If you still have trouble, send another message and include that part of your CL program.
From: Tim Johnston To: Dennis Detwiler
I know where you are coming from. In addition to Ted's comments, here's another trick I try. Once I run the OPNQRYF against the file, I will do a Copy From Query File (CPYFRMQRYF) command to a file in QTEMP. Then I will look at it with the Run Query (RUNQRY) command like this:
RUNQRY QRYFILE((QTEMP/file))
This gives me a picture of what data is being fed to the program. With me, nine times out of ten, it's the *ANDs and *ORs that give me a headache.
TechTalk: Selecting Records With OPNQRYF
Figure 6 Overriding a File Used by OPNQRYF to SHARE (*YES)
OVRDBF FILE(XYZ) SHARE(*YES) OPNQRYF FILE((XYZ)) QRYSLT(whatever) etc. CALL PGM(HLLPGM) CLOF OPNID(XYZ) DLTOVR FILE(XYZ)
LATEST COMMENTS
MC Press Online