PGM OVRDBF FILE(file1) SHARE(*YES) OPNQRYF FILE((file1)) OPTION(*INP) + KEYFLD((*MAPFLD/fld1)) + MAPFLD((fld1 '%SST(1/fld1 1 2)' *CHAR(6)) CALL PGM(pgm1) CLOF OPNID(file1) DLTOVR FILE(*ALL) ENDPGM
Without knowing more about your DDS and particular application, I'm not sure I can make a good suggestion about how to fix your OPNQRYF statement but it sounds as if you are only using the OPNQRYF to substring a new field from an existing field anyway. You can make a field in your logical file that is based on a substring of an existing field and then you could skip the OPNQRYF completely. Here is an example of how you would do that. In this example, field TSTSST is an input only field based on field TSTFUL that begins at position 4 of field TSTFUL and then uses 2 characters of the TSTFUL field.
Ex. A R ILCTSTFM PFILE(TSTFIL) A TSTFUL A TSTNAM A TSTADR A TSTUSR A TSTDAT A TSTTIM A TSTSST I SST(TSTFUL 4 2) A K TSTSST A K TSTUSR A K TSTDAT A K TSTTIM
================================== 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.
This was first published in December 2002