ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Pf and lf relation

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

  • Pf and lf relation

    Hi,

    If a pf has duplicate records and it has a lf with a unique keyword. Will that lf get complied n if yes wat records will it display

  • #2
    You won't be able to compile the LF over the file if the LF specifies UNIQUE and there is a duplicate key (for the key fields defined in the LF). It will give an error when you try to compile it.

    Comment


    • #3
      You could build an empty physical file and create the locical file based on that.
      Then you can use CPYF to eliminate the duplicate records given that you don't care what records are being dropped.

      Copy from your file with duplicates to the new empty physical file.

      CPYF FROMFILE(FROM) TOFILE(TO) MBROPT(*ADD) ERRLVL(*NOMAX)

      Comment

      Working...
      X