Creation of logical file

pts.
Tags:
Programming Languages
RPG
Can I create a logical file in some other library that is different from the physical file's library on which the Logical is based.. OR both PF and LF need to exist in the same library??

Answer Wiki

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

You can put them in separate libraries but its a better policy to put them in the same one. That way, you’ll only worry about adding the one library to library lists in job descriptions, etc.

Discuss This Question: 9  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
  • astradyne
    When you create the logical file the qualified name of the physical file (i.e. file name and library) are stored in the LF definition. If you create the logical file in a different library to the physical, you don't have to have the physical file's library in the library list to pick up the data as the logical file knows where to get it from. That said, I have to agree wholeheartedly with the previous response that it is not good practice to have logicals and physicals in different libraries because: a) it can lead to confusion and make maintenance difficult. b) some change control systems don't handle it. c) potential locking issues during backups. d) just because :) All the best Jonathan
    370 pointsBadges:
    report
  • Jaicee
    For the reasons already mentioned, it's best to keep logicals (LF) in the same library as the physical (PF). It also makes restoring files much easier because the system will do all the work of sequencing the restore. If you put them in seperate libraries you have to ensure that you restore the PF first, then LFs based on the PF, then LFs based on LFs. It can get really messy! Another thing to consider is Testing. If you create a LF in a test library over a PF in a production library and forget about it (which isn't hard to do), you'll have a big problem later on when you realize people have been modifying live data when testing. We have a package written by a vendor who likes to break all of the iSeries "rules" and they've caused an incredible amount of problems. So we've created our own "rule": A PF and all of its dependent files are considered as a group. So if we are changing or adding anything in or to the group, the whole group has to move between test and production (not just the object being changed or added). You may want to read up on this stuff in the iSeriesBackup and Recovery Version 5 (SC41-5304-07).
    0 pointsBadges:
    report
  • JoAnnB
    And as usual my company is the exception to the rules. We have some logicals in a LOGLIB and the physicals in another library. I don't know who started that here but it was in place long before I arrived. It doesn't get too confusing but there definitely is a learning curve. We also have a completely seperate Test machine so we don't usually have a problem with testing. However, when we do need to change what library we want to get the file from we'll create a test cl with overrides to the test library.
    0 pointsBadges:
    report
  • Cmasse
    the logical file can be in an another library.
    0 pointsBadges:
    report
  • Ljpaque
    Another reason to try to keep the logical file in the same library as the physical file is the CRTDUPOBJ command. If you CRTDUPOBJ a LF when they are in the same library then the LF will be attached to the PF in the destination library automatically.
    0 pointsBadges:
    report
  • Cpujbl
    The question isn't really can you or can't you put the logical into another file but why would you want to? The benefits to doing so have to be greater than the risks. Our clients have the ability to change their library lists and we have to be extremely careful about what data they are seeing so all the logicals have to be in the same library as the physical files. We have had problems where somebody accidentally compiled the logical into the wrong library and this caused problems for our clients. If the library with your logical is in the wrong position within the library list and data is being updated you could be changing the wrong data. If the library with the logical is only going to be in the liblist with the library of the physical file then why have it in a seperate library to begin with? Yes, you can compile a logical into any library you want but then you need to make sure your maintence procedures are in place like JoannB's shop.
    0 pointsBadges:
    report
  • Rigger
    There is also a very large issue of restoring files should you need to. When the logicals reside in a different library than the physicals, the logicals cannot be restored unless the physical have been restored first. Could be a nightmare when you're under pressure to get your system right.
    0 pointsBadges:
    report
  • Tbfleet
    All of the previous posts have been good considerations. While our policy is to place the LF in the same library as the PF, we do have a few LF that join files over multiple libraries. These are always headaches when we need to do restores, as they must be manually created or the restore needs to be carefully monitored to be sure all the needed PF are on the system. Good Luck
    0 pointsBadges:
    report
  • TomLiotta
    One reason to place a LF in a different library is that the LF presents a view of a subset of fields from the PF. The remaining fields cannot be accessed through the LF. Then grant *EXCLUDE authority to the PF library. At that point, you have a secured subset of fields with no access to the secured fields. This is an old technique that is nearly obsoleted with column-level SQL security. Tom
    125,585 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