ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Prefix and can not chain successfully

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

  • Prefix and can not chain successfully

    Hi, I am trying to use file1 in my program. but It said fields are not defined

    Since some same keys in PGM, so I use the prefix.

    Code:
    ffile1    if       e          k disk  prefix(ST:2)
         chain (STKEY1:STKEY2: STKEY3) file1;
    the error is STKEY1, STKEY2, SYKEY1 are not defined, anybody knows why? Thanks

    Just in case, the FILE1 is
    Code:
    A                                                   UNIQUE       
    A          R NRC                            PFILE(FILE)
    A          K FRKEY1                                 
    A          K FRKEY2                                
    A          K FRKEY3

  • #2
    I have just tried this on my V7.4 system and it works fine - as it should.

    Are you perhaps missing a PTF or three?

    Comment


    • #3
      Originally posted by JonBoy View Post
      I have just tried this on my V7.4 system and it works fine - as it should.

      Are you perhaps missing a PTF or three?
      There is another error I missed, Record format NRC in file file1 already defined; record format is ignored. How to fix this?

      Comment


      • lxb0007
        lxb0007 commented
        Editing a comment
        Rename the file?

    • #4
      Thanks, I think I fixed it, it's because the file type already defined before.
      Code:
      ffile1  if   e           k disk    rename(nrc:nrcg) prefix(ST:2)
      Then no error

      Comment

      Working...
      X