Reading files created by QUERY/400

When QUERY/400 creates a database, it gives the file and the record of the file the same name. RPG will not compile if the file name and record name are the same.

So, you must rename the record. For example, if you are reading a file named QRYFIL and that file was created by QUERY/400, you need to rename the record name to anything unique... in this case QRYREC

 
RPG/400


 FMT FX .....FFilenameIPEAF........L..I........Device+......KExit++Entry+A....U 
     
0061.00      FQRYFIL  IF  E                    DISK                      A      
0062.00      F            QRYFIL                            KRENAMEQRYREC          


RPG/IV

 FMT FX FFilename++IPEASF.....L.....A.Device+.Keywords+++++++++++++++++++++++++
                              
0116.00 FQRYFIL    IF   E             DISK                                     
0117.00 F                                     RENAME(QRYFIL:QRYREC)     
 
 
or simply

0116.00 FQRYFIL    IF   E             DISK    RENAME(QRYFIL:QRYREC)




Back to Basic AS/400 Tips    |    Back to Main Page    |   Contact Info