ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Updating a file on multiple boxes

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

  • Updating a file on multiple boxes

    Hello,

    I am looking for a way of updating the same file on about 13 different boxes, I'm open to most suggestions as long as they don't involve changing iSeries configurations (like adding records to the database directory)

    Usually I just login to each machine and update it through STRSQL, but this is monotonous and mind numbing.

    We have a central development box that has access to the boxes I want to update (i.e. via FTP or TELNET) so the plan is to create something on that box which updates the files on the relevant machines.

    The file probably isn't important but the details are;

    Code:
    A          R RAREPEMR                                              
     *                                                                  
    A            EMREPN        15          COLHDG('Report' 'Name')      
    A            EMAIL1        40          COLHDG('Email' '1')          
    A            EMAIL2        40          COLHDG('Email' '2')          
    A            EMAIL3        40          COLHDG('Email' '3')          
    A            EMAIL4        40          COLHDG('Email' '4')          
    A            EMAIL5        40          COLHDG('Email' '5')          
    A            EMPREF         1          COLHDG('Data' 'Lib' 'Prefix')
    There are 2 records in the file on each box currently, an example being;
    EMREPN EMAIL1 EMAIL2 EMAIL3 EMAIL4 EMAIL5 EMPREF
    ACTIVE DONTCHANGE@EMAIL.COM V
    AVAILABLE CHANGEME@PLS.THX V
    The only variant here is EMPREF, it's different depending on the machine it's on.
    I want to change EMAIL1 where EMREPN is 'AVAILABLE'

    This isn't a critical file, it can be deleted/slapped about/etc. if that's what is required to do what I need.

    Thanks in advance,
    Ryan
    Last edited by RDKells; September 14, 2017, 06:48 AM. Reason: Clarifications of what I wanted to change

  • #2
    Do you have SQL Server? If so, you could create a Linked Server for each iSeries and then have a script that ran against each Linked Server.

    Comment


    • #3
      What user profiles are known on each box? Pretty much no matter how it's done, it won't be by bypassing security/logon requirements.

      So if all systems can be accessed, RUNRMTCMD can run RUNSQL to update the file. And if the value will be different on different systems and the value can be determined fairly easily, then FTP might load a REXX proc than can be run with STRREXPRC. The proc could determine the appropriate value and build and run the needed SQL.
      Tom

      There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

      Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

      Comment


      • #4
        Another alternative might be to use DDM files. Create a DDM file to the file(s) on each system and do all the updates from the source.

        Comment


        • #5
          I have SECOFR access on all boxes.

          I didn't realize you could run RUNSQL through RUNRMTCMD - I have just tried it and it worked, thanks!

          Comment

          Working...
          X