Reputation: 31
I need to be able to lookup the Select/Omit critera of an AS/400 Logical File using SQL. I cannot use DSPSELOMT.
I figured out how to query whether or not the Logical File has Select/Omit critera by looking at the SELECT_OMIT column in SYSTABLES. (IBM i catalog tables and views)
However, I cannot figure out how to query the criteria used in the Select/Omit statement. How can you view the Select/Omit critera using SQL? If it's not possible, could you cite a source?
Thanks in advance.
Upvotes: 3
Views: 1282
Reputation: 4542
The traditional method would be to use the DSPFD
command, with TYPE(*SELECT) FILEATR(*LF) OUTPUT(*OUTFILE)
. You can then use SQL to read the select omit criteria from your output file. If you cannot directly execute the CL command, you might put it inside a stored procedure or user defined function. Other options to execute the command may be available depending upon what environment your process is running in.
Upvotes: 1