I don’t think you will be able to compile a program with externally defined F-specs regardless of the USROPN clause. The compiler still has to check the record name, field names and types, etc, so it still needs the files.
I would expect the same problem with SQL.
I think you will have to install a set of empty files to be able to compile the programs then you might want to delete them, although then a recomile at any time would be impossible. Alternatively you could provide the compiled object to your clients – you can sometimes compile to an earlier version.
It depends on what type of SQL coding you are using. Are you using Static or Dynamic SQL within your RPG program? If you use Static, then the SQL precompiler will check the file and make sure the sytnax of the SQL is corrrect (file exists, fields referenced in file exist, etc.). However you can get around the precompiler by using dynamic SQL. With dynamic SQL you create a text string that contains the SQL statement you wish to run and then use the Prepare statement . I have a program where I pass a file and field name into the program and then create a SQL query to return a list of values from the file/field combination. It will work for any file. And I don’t have to define the file in the F specs. One thing to be aware of using dynamic SQL is that any errors in syntax will cause errors at run time and can not be caught beforehand because the precompiler does not evaluate your SQL statements.
Joy is absolutely correct.
Dynamic SQL would work for your application, but as she pointed out, there is no error checking of the command at compile time.
i made sure i won compile anything at client side….
this means i can very well run static sql depending upon the conditions met for an application..