Here's a way to convert DB2/400 logical files to views automatically. Programmer's can write a small utility to convert all DB2/400 logical to views.
For example: You have a physical file (ORACLE, is the name of the file).
ACCOUNT 4S 0
And the Logical Over the above file is ORACLE1
R ORACLER PFILE(ORACLE)
S TYPE COMP(EQ 'A')
Need to do the following steps:
Use the following command to get the file information:
DSPFD FILE(*LIBL/ORACLE1) TYPE(*SELECT) OUTPUT(*OUTFILE) OUTFILE(*LIBL/ORACLEOF)
Once you have executed the above command, ORACLEOF will be created.
Use the following fields to get the Select/Omit information from ORACLEOF:
SOFLD (To get the Select/Omit fields)
SORULE (To get Select/Omit Flag)
SOCOMP (Comparison flag like EQ, GT, GE etc.,)
SOVALU (To get the comparison values etc.)
With the above information, you can able to build the SQL Statements (Views)
MORE INFORMATION ON THIS TOPIC
The Best Web Links: tips, tutorials and more.
Ask your programming questions--or help out your peers by answering them--in our live discussion forums.
Ask the Experts yourself: Our application development gurus are waiting to answer your programming questions.