Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

OPNQRYF Problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • OPNQRYF Problem

    Change your paired single quotes('') to an actual double quote("), and and is *AND. (Sorry couldn't resist that)
    Code

  • #2
    OPNQRYF Problem

    Thanks Kevin...

    Comment


    • #3
      OPNQRYF Problem

      Maybe I missed it, but I did not see a shared open. You must specify SHARE(*YES) on the OVRDBF command. Dave

      Comment


      • #4
        OPNQRYF Problem

        Thanks DAvid.... In addition, I want to eliminate the FORMAT option, but wanted to use 2 physical files having 2 different record layouts. Is this possible ? I just would like to pick-up the required fields. Can MAPFLD option do the trick ? TIA

        Comment


        • #5
          OPNQRYF Problem

          It is possible if there are common fields between the 2 files so that you can join them. Look at the JFLD parameter. You may need *MAPFLD to pick the proper field if the fields have the same name in both files.

          Comment


          • #6
            OPNQRYF Problem

            Ted, Based on my posted source code, the 2 files I joined have distinct field names, I used a JFLD and a FORMAT parms. I want to eliminate the FORMAT parm. My concern is how to pick and choose the resultant fields out of the total fields from files A and B. File A File B A1 key field B1 A2 B2 A3 B3 I want to include A1, A2 and B2 fields in the result if A1= B1. My question is what should I include in my MAPFLD or MAPFLD is not needed because of the unique field names? TIA

            Comment


            • #7
              OPNQRYF Problem

              Attached is the code snapshot. It doesn't like the first AND in the QRYSEL variable. Any suggestions. TIA.
              Code

              Comment


              • #8
                OPNQRYF Problem

                You can't eliminate the FORMAT parm when you join files. You'll have to create a physical file that has the fields you need. You don't have to put any data in it or even put a member in it. Use that file in the FORMAT parm & make your HLL program read that file. If all of the fields in the FORMAT file are found in one file or the other, not in both, you won't need the MAPFLD parm.

                Comment

                Working...
                X