Difference between source physical file and physical file on AS/400

Tags:
AS/400
Physical File
What is AS/400? Difference between source physical file and physical file?

Answer Wiki

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

Source Physcial file (PF-SRC) contains program source code.
PF-DTA contains data.

The PF-SRC file will contain one member for each program source code.
The PF-DTA file may contain one or more members, each can contain any number of records.

Hope this helps, feel free to ask more.

Discuss This Question: 22  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.
  • dinuas400
    Both are physical files... Both can contain many members... But PF-SRC in general we are having our programs... if you want to view the members of your PF, You can use WRKMBRPDM and give the LIBNAME/PF name
    510 pointsBadges:
    report
  • vishalat009

    Can we create a logical view of Source physical file ?


    70 pointsBadges:
    report
  • CharlieBrowne

    Why would you want to do that?

    62,265 pointsBadges:
    report
  • azohawk

    I have never heard of creating a logical over a source file. I wonder why you would want to do so.

    If you can tell us that, we might be able to provide you with a way to accomplish what you are trying to do.

    2,060 pointsBadges:
    report
  • CharlieBrowne
    A source PF only has 3 fields. What would you want your access path to be? How would you use it?
    62,265 pointsBadges:
    report
  • ToddN2000
    in theory you could create a logical over the source physical. But why would you and for what purpose? Only valid original source would compile cleanly. Also source physical have a fixed record length and specific field/columns.
    59,500 pointsBadges:
    report
  • vishalat009

    Greeting everybody. Thanks for your comment.

    Actually I am trying to create a tool which will fix the COBOL/400 coding standard. This is the reason why I want to read SOURCE physical file member.

    70 pointsBadges:
    report
  • CharlieBrowne
    OK. So you do not need to create a LF. You can read the PF. Seems like what you want to do is to do a loop in your program to process each member. That makes sense and is a common task.
    62,265 pointsBadges:
    report
  • ToddN2000
    Post a sample of your looping code if you have any issues and we can help straighten it out. There are a few ways it can be done and you may have a preferred method.

    59,500 pointsBadges:
    report
  • vishalat009

    Hi Everyone ,

    Thanks for your support in giving feedback. Now the issue is solved.

    My next query is about DB2. I will give you a situation where ,

    You have 1 physical file and another physical file which is clone for 1st one in another library.

    Now , as per implementaion , there is a neccasity to change the 1st physical file. here I would like to know whethere we can do same changes to 2nd physical file in another library without refreshing or modification ?

    It will be kind Referential Integrity ?

    I would be great to here from you guyz :)


    70 pointsBadges:
    report
  • CharlieBrowne
    For your new query, my question is why can you not run the same procedure over the 2nd file as you will do over the 1st one.
    62,265 pointsBadges:
    report
  • ToddN2000
    Are you looking to update the second PF with the same input data used for PF 1?
    59,500 pointsBadges:
    report
  • vishalat009
    Hello Everyone,

    I just wanted to create Referential integrity concept here. Second PF is just clone / referenced from 1st PF. So my question is if I changes / modifies structure of 1st pf then automatically it should reflect changes to 2nd PF. I am not trying here update or copying data.
    70 pointsBadges:
    report
  • philpl1jb
    Is this a structure change, a data change, or a referential integrity change? Tell us more.

    54,090 pointsBadges:
    report
  • vishalat009
    I wanna do structural change to 1st P. Is there any way to reflect those changes to 2nd PF automatically without running any procedure?
    70 pointsBadges:
    report
  • CharlieBrowne

    Cannot change file structure easily.

    What process are you using on the base file to make the change? Are you doing a CHGPF or SQL Alter Table? Or are you totally recreating the file and copying the data back into it?.

    62,265 pointsBadges:
    report
  • philpl1jb
    no, you would have to repeat the process or some process similar process, for each instance of the file.
    54,090 pointsBadges:
    report
  • GregManzo
    Hmm, sounds like you are trying to replicate data to a new version of a table with an updated structure (as part of a software upgrade maybe?). If not then ignore this comment.
    We had the same issue with needing to upgrade several very large tables such that we could not afford the downtime to convert the data offline (would have taken days). The solution was to read the journal and use the before/after images to make the same update to the new table. We ended up building a generic solution with one restriction - the table had to have at least one unique key without select/omit to identify the record to be updated.
    In gross terms it goes like this: 
    pgmA issues a RCVJRNE command specifying pgmB to receive the entries;
    pgmB saves the before image for an update, then passes it and the after image to pgmC (or only image for add/delete)
    pgmC has two data structures internally, one in the old format & one in the new. You use the before image to get the key to the record, chain to the new file, then map the data from the after image to the new structure & update.
    Make sure the new file doesn't have triggers or they may duplicate any cascaded updates that the old file trigger has already done.
    To initialise, pgmD reads the entire old file and passes every record to pgmC as an add operation. You can run the two in parallel (initialise while applying current changes) if your application doesn't update the key fields, but it's safer to just remember the point in the journal where you started.
    660 pointsBadges:
    report
  • vishalat009
    Greetings Everyone.

    I would like to know how we can get Old RRN and New RRN value for a File after RGZPFM command?
    70 pointsBadges:
    report
  • ToddN2000
    @vishalat009: Unless you are hard coding RRNs in your programs it should not matter. Most of the time you are setting a pointer with SETLL, SETGT or doing a chain to get the data.. If there is a business case for this, post your code so we can better understand why the RRN value before/after is important.
    59,500 pointsBadges:
    report
  • vishalat009
    Please consider following scenario, As/400 machine has a Business data which send to Front End Data warehouse application which is based on Oracle database. As/400 system has a file wit FIFO method so there is possibility of having multiple record with same primary key.

    Now Oracle database wants to build a File with Primary key as per Oracle database. In this case, they are taking help of RRN field.

    Now, yearly once maintenance team performs Reorg on As/400 files resulting RRN value changes.

    To identity the record correctly, we need to identify Old and new rrn

    70 pointsBadges:
    report
  • GregManzo
    After the RGZPFM has run there is no way to get back the original RRN (short of saving record keys in another table), nor is there any good reason to need to do this.
    I suggest you take a good look at your data design and find another field to extend your key to make it unique, and stop relying on RRN. If all else fails add a created date or timestamp field.
    660 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.

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

Following

Share this item with your network: