ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Check File Attribute 'PF'

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

  • Check File Attribute 'PF'

    I have a physical file containing names of different files with attributes *FILE, *PRTF,etc.
    Files with attribute *FILE are PF and LF but that is not mentioned.

    I have to store only files with attribute PF in another Table(PF).

    I have written a RPGLE PGM which Reads the contents of the File and Look for *File attribute and store it to a PF.

    Then I am Calling CL PGM which is taking param as Lib. Name and Obj. Name from the PF. Then i use DSPFD cmd with FILEATR *PF to check for PF. And when DSPFD gives error that the object is not PF then i do not store the Object to another PF, otherwise i would store the object.
    But the erroe given by DSPFD Command :

    FILEATR specified not valid for *LF file CNTLF2

    Can not be monitered by MONMSG.

    Is there any way out to monitor this error.

    Or alternately can any one suggest some other procedure to do this.

    Thanks
    SAM

  • #2
    hi sam400 have u tried to catch with this


    CPF3020 No files in &1 in &2 have the specified FILEATR.


    MONMSG MSGID(CPF3020) EXEC(what u what to do)

    saw at CL reference.

    "It's like a koala pooped a rainbow on my head and I can taste the colors."

    Comment


    • #3
      A cople other options

      You could use IBM system table QADBXREF and look at field DBXATR this will be populated with 'PF' or 'LF'

      You may need to get authority to file you could use code here to see how I access the file




      or if you are just wanting a check object for physical file use api

      QUSRMBRD

      There is an example on site look at API's or I have a versionat home that actually does a check object by type...Physical, library, outqueue, profile....etc I will post tonight.


      Take care
      Jamie
      All my answers were extracted from the "Big Dummy's Guide to the As400"
      and I take no responsibility for any of them.

      www.code400.com

      Comment

      Working...
      X