ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Compare all files in two libraries

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

  • Compare all files in two libraries

    This tool will compare all physical files in two different libraries against each other and prints a report of the differences.

    I wrote this to compare new versions of a software product.


    Hope it helps
    It uses API's and the system table QADBXREF. Oh! ya and SQL

    Must be compiled as SQLRPGLE.

    Take care
    Jamie
    Attached Files
    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

  • #2
    Re: Compare all files in two libraries

    Hi There...
    I have a file with about width of 11752 and 300+ coulmns....5 to 10 records....I am planning to create a copy of this file and update the column values to the ones I want...and compare is to the original file and report on differences....I could get the record line, however to get the column....its a long CL pgm to identify the column name........Do you have any code/API which will find the difference.....Thanks Usman
    I hope I am able to explain....

    Comment


    • #3
      Re: Compare all files in two libraries

      use API to list fields of both files then compare them....
      This program lists the fields and attributes, just modify it to check multiple objects.



      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


      • #4
        Re: Compare all files in two libraries

        Thanks....however this will not do what I want....I think...as I am not a programmer.....
        That FFD is just giving me the list of fields which in my understanding I have anyway when I create the file....

        I will explain again....I do not know if FFD will make it easier for me....
        I created a file using command
        DSPUSRPRF USRPRF(*ALL) OUTPUT(*OUTFILE) OUTFILE(QTEMP/PRF)
        Then I ran command
        CRTDUPOBJ OBJ(PRF) FROMLIB(QTEMP) OBJTYPE(*FILE) TOLIB(QTEMP) NEWOBJ(PRFTMP) DATA(*YES)
        and used UPDDTA on file PRFTMP and updated fields on few porfiles as a standard.....

        Now on weekly basis I want to run command
        DSPUSRPRF USRPRF(*ALL) OUTPUT(*OUTFILE) OUTFILE(QTEMP/PRF)
        and compare it with feilds in the PRFTMP file and report the differences in a message queue

        Comment


        • #5
          Re: Compare all files in two libraries

          I think you are going to have to make friends with a programmer....
          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


          • #6
            Re: Compare all files in two libraries

            Thanks....
            I have already started the pgm...need little push...

            PGM
            DCL VAR(&STSA) TYPE(*CHAR) LEN(10) VALUE(*ACTIVE)
            DCL VAR(&STSB) TYPE(*CHAR) LEN(10) VALUE(*ACTIVE)
            DCL VAR(&STSC) TYPE(*DEC) LEN(10 0) VALUE(0)
            ..
            ..
            ..
            DCLF FILE(TECH2/XXXXSTS)
            READ: RCVF
            MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(END)) /* If +
            end of file, quit. */
            IF COND(&STS1 *NE &STSA) THEN(DO)
            *************Where do I keep the value if not active*********
            ENDDO
            IF COND(&STS2 *NE &STSB) THEN(DO)
            *************Where do I keep the value if not active*********
            ENDDO
            IF COND(&STS3 *NE &STSC) THEN(DO)
            *************Where do I keep the value if not active*********
            ENDDO

            *************Compile the data stored above and send a message*********

            Comment


            • #7
              Re: Compare all files in two libraries

              Hi Usmanjee:

              could you clearly state the purpose of this exercise..(what fields do you want to compare...What do you want to do with changes...etc)...
              I happen to know a grumpy old programmer

              GLS
              The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

              Comment


              • #8
                Re: Compare all files in two libraries

                For our HA software....there is no good way to monitor the links....so taking a snapshot in an outfile and then using it to copy it to new file which I will use as template and update it with values which every one like
                and ten on posibbly hourly basis take a snap shot and compare certain feilds with template file and post a message to QSYSOPR....which will be monitored and alert team....

                Comment

                Working...
                X