I need a field that is the substring of the original field but still have the same length in order for override...
By submitting your personal information, you agree that TechTarget and its partners may contact you regarding relevant content, products and special offers.
to work. As an example, I can build a temporary access path for what I need using OPNQRYF,but I can't make it permanent because DDS does not allow me to define length for a field that is a SST of another field. Can you help?
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.
Dig Deeper on iSeries CL programming
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.