Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

OPNQRY result issue

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

  • OPNQRY result issue

    I've got an OPNQRY thqt if I put the results into a file via CPYFRMQRYF the dataset is correct, but if I run DSPPFM on the file it doesn't.

    The code I use:

    DCL VAR(&SELECTA) TYPE(*CHAR) LEN(93) +
    VALUE('CONO55 *EQ "DA" +
    *AND DNSD55 *EQ 1130102 +
    *AND (ORDN55 *GE "0607691" *AND +
    ORDN55 *LE "0607691")')

    OVRDBF FILE(OEP55) SHARE(*YES)

    OPNQRYF FILE((OEP55 *FIRST *ONLY) (OEP55E *FIRST +
    *ONLY)) OPTION(*INP) FORMAT(OEP55) +
    QRYSLT(&SELECTA) KEYFLD((OEP55/CONO55 +
    *ASCEND *N) (OEP55/ORDN55 *ASCEND *N) +
    (OEP55/ORDL55 *ASCEND *N) +
    (OEP55/CATN55 *ASCEND *N)) +
    UNIQUEKEY(4) JFLD((OEP55/CONO55 +
    OEP55E/CONO55 *EQ) (OEP55/ORDN55 +
    OEP55E/ORDN55 *EQ) (OEP55/ORDL55 +
    OEP55E/ORDL55 *EQ)) MAPFLD((CONO55 +
    'OEP55/CONO55' *CALC *N *N *CALC) +
    (ORDN55 'OEP55/ORDN55' *CALC *N *N +
    *CALC) (ORDL55 'OEP55/ORDL55' *CALC *N +
    *N *CALC)) SEQONLY(*NO)

  • #2
    Hello Stuckinparis! The DSPPFM does NOT share an existing open data path, so what you see via DSPPFM is not altered by the OPNQRYF. The CPYF command too does not share an open data path. I would assume that is why we have the CPYFRMQRYF command.
    Last edited by bbardini; 01-09-2013, 05:42 PM.

    Comment


    • #3
      DSPPFM means Display Physical File Member. The dataset generated by OPNQRYF is not a physical file and consequently cannot be seen by DSPPFM.

      As you have already mentioned, once you have copied the dataset to a physical file using CPYFRMQRYF you can use DSPPFM to look at the data.

      The same is true if you want to use RUNQY *NONE QTEMP/TEMPFILE to show the content of the table/PF.

      Of course, as I'm sure you know, if you want to process the dataset in a program you can do an override that allows a called program (or even this CLP) to share the dataset and process it. Your code snippet includes such an OVRDBF command already so I'll assume you know all about that.
      Last edited by WoofDog; 11-13-2013, 05:12 PM. Reason: spelling error

      Comment

      Working...
      X