ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Can we get source from Object (PF)??

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

  • Can we get source from Object (PF)??

    is it possible to get back the source of a pf from its object??

  • #2
    Yes you can

    You can buy TAATOOLs and use RTVPFSRC --or--

    you can use API - QUSLFLD - List fields in a file.

    from this API you get field name, field description, size and type.
    this is all you need to create a physical file.

    Source members have 3 fields SRCSEQ , SRCDTA, SRCDAT
    You will be writting to SRCDTA.

    All you have to do is rename the format and override to a new member. Then write the data retrieved from the API to the source physical file member.

    Here are a couple examples:





    You can use this source to build a tool to retrieve source from an object.


    good luck

    Comment


    • #3
      Re: Can we get source from Object (PF)??

      I realize this is an old thread but for anyone else reading I have a suggestion.
      If you use DBU (database utility) you can F4 to view the list of fields then F9 to export the source to a source file member. I've had to do that a couple of times and that sounded like what you were trying to do. The only caution is to pay attention to your format names when you export.
      Bryan (aka Hamstersniffer)

      Comment


      • #4
        Re: Can we get source from Object (PF)??

        An even easier way (and free): Open Navigator, open Database, open Tables, right-click and "Generate SQL". All the SQL code needed to build this file is generated.

        Comment

        Working...
        X