In a query I can display five records equal to the key I am using within my program, but when I reade within my program, I am only accessing three records. It's like it's reading every other record. Any ideas??
so how do you know the reade,,, only gives you 3 records, is it thru a display file, or report or what?? I ask deleted records, because old S36 Files/programs do not necessarily actually remove the record,, they just mark it in some way ,, so the following programs knows,, it had been deleted.. as a "D",, in column 1, etc, etc. just trying to cover all the bases.
I checked the file description. There are no deleted records in the file. I ran both the query and the program over the same logical. I've checked to make sure there are no other files with the same name. I know it reads three records, because I put the program into debug and only three records were read before leaving the loop.
Are you sure ran both in same logical file? Did you qualify your query with the library name? How about using STRSQL and do a plain select statement. Did you look at the source definition of the logical file? and can you publish it here?
The system I am working on does not have SQL. the logical COHSTTL5 is the ONLY object on their system by that name, so I know the query and program are using the same file.
Below is the logical. Nothing unusual about it.
5722SS1 V5R2M0 020719 Data Description TLVLIB
File name . . . . . . . . . . . . . . . . . . . . . : COHSTTL5
Library name . . . . . . . . . . . . . . . . . . : TLVLIB
File attribute . . . . . . . . . . . . . . . . . . : Logical
Source file containing DDS . . . . . . . . . . . . : QDDSSRC
Library name . . . . . . . . . . . . . . . . . . : TLVLIB
Source member containing DDS . . . . . . . . . . . : COHSTTL5
Source member last changed . . . . . . . . . . . . : 06/16/05 14:45:16
Source listing options . . . . . . . . . . . . . . : *SOURCE *LIST
DDS generation severity level . . . . . . . . . . . : 20
DDS flagging severity level . . . . . . . . . . . . : 00
File type . . . . . . . . . . . . . . . . . . . . . : *DATA
Authority . . . . . . . . . . . . . . . . . . . . . : *LIBCRTAUT
Replace file . . . . . . . . . . . . . . . . . . . : *NO
Text . . . . . . . . . . . . . . . . . . . . . . . : Payment History Tax
Compiler . . . . . . . . . . . . . . . . . . . . . : IBM AS/400 Data Descr
A R COHSTT5
A PFILE(COHSTT)
A TRDATE R
A TRTIME R
A STRAN# R
A TRSEQ# R
A TOTLPD R
A SPECPD R
A SPECPI R
A TAXPI R
A ADFEE R
A TWNSHP R
A RSECTN R
A RRANGE R
A RSUBD R
A RBLOCK R
A RPAR# R
A TAXYR R
A TXRPT# R
A PONAME R
A TRMD I SST(TRDATE 1 4)
A TRCY I SST(TRDATE 5
A K TWNSHP
A K RSECTN
A K RRANGE
A K RSUBD
A K RBLOCK
A K RPAR#
A K TAXYR
Total Informational Warning Error Severe
(0-9) (10-19) (20-29) (30-99)
0 0 0 0 0
IN your debug,, do you display the key field,, maybe,, you are assuming something,, that while you think is correct,,, does not pan out like you want it??
I put a break directly after the read statement. I've done a step thru numerous times. Only three records are read. What's strange is it's every other record of the five records! I'll follow thru with your SQL suggestion and move the file to our system and try that.
Can you do the following in the AS400 command line?
DSPFD FILE(Libname/File) for both the physical and logical file. Go to the end screen(bottom) and it should
tell you how many records.
If the records are the same then are you using a dumb terminal or PC emulation to AS400? If PC emulation then
what product are you using. How do you run your queries?
This brings an old issues where I have to install a patch in both the host and PC emulator because of certain bug when doing queries
Can you also publish here the RPG program? Only the statement where the READE operation was used and the key structures of the search key. There might be some differences with the search key structure vs file format.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.