AS/400 Compilation

70 pts.
Tags:
AS/400
PF identifier
I am a beginner in AS/400. I have a question to ask. When we are compiling a Physical File, it will generate a unique code something like identifier right? So I will compile the program with this PF. Now my question is, if I have two libraries which contain this PF with same identifier, when I execute the program, which one should it refer to?Assume library A and library B. In my library list (EDTLIBL) the top is A and below is B. However, I check with DSPPGMREF for my program and search for the PF and I saw it point to library A. But since library A and B contain this PF with same identifier. Can it be execute without getting any error even I removed the library A. Hopefully you guys understand my queries.

Answer Wiki

Thanks. We'll let you know when a new response is added.

As long as both files have the same File Level Identifier you will be fine.  If the file(s) in question are opened with SQL the job may not even check the File Level Identifier.  

Compile the program and look for the File Level Identifier within the listing.

For performance issues you should use SQL to create and modify physical and logical files and not DDS.

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • philpl1jb

    DSPPGMREF shows the library of the target file that was used during the compile.  During run time the program will attempt to open the first file with the file name that it finds in the library list.  If the level check doesn't match the compiled program an error will be thrown.

    So it's the run time library list.  (Unless your programs contains some special provisions to specifically control the library/file).

    49,570 pointsBadges:
    report
  • ToddN2000

    You can run the program without errors only if library B stays in your LIBL and has the same format as the version of the file did in library A.

    If there are difference you will get a level check error.

    Some departments will have the same file in multiple libraries, say one in their test environment TESTLIB and another in the production environment PRODLIB.

    8,500 pointsBadges:
    report
  • yeepiyaya
    so that's mean it will always match with the identifier code first right? because currently my program might referring to another PF which in others library. So i don't know how I'm going to check whether my program is compiled to which PF? My scenario is like this, my program getting CPF4328 error which I've check with DSPFD and the file is currently journaled.(*Yes) but it get CPF4328 error. I have no idea to check.
    70 pointsBadges:
    report
  • CharlieBrowne
    As long as you have the same file identifier for both files you do not have to worry about which one the program was compiled against. When the program is called, it will find the first occurrence in your libl.
    I suggest you always try to not have the same object name in different libraries if they have different definitions.
    41,370 pointsBadges:
    report
  • philpl1jb

    Check dsppgmref Format Level Identifier

    against the Format Identifier at the bottom of DSPFD

    The use of the Format Level Identifier is to prevent the program from using a wrong record structure and reading or writing records that have the wrong structure.

     

    CPF4328 .. journaling error would indicate that the copy that's in the run time library list is not journalled.  That has nothing to do with the Format Identifier.

    49,570 pointsBadges:
    report
  • yeepiyaya
    but how I'm going to check whether the file being journaled or not?
    Not by DSPFD?
    70 pointsBadges:
    report
  • CharlieBrowne
    Yes, DSPFD will tell you if the file is being journaled
    41,370 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following