• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Copy a Subset of Records from One System to Another

    September 27, 2006 Ted Holt

    Recently, I needed an easy way to refresh a development system with a subset of records from a file on a production system. I needed a method that I could run unattended, during off hours. FTP, the Save-Restore commands, and the third-party file transfer utilities available to me are good tools, but they have their drawbacks. All of them require me to transfer complete files, even if I only want to transfer a subset of records. And it is difficult to determine whether FTP succeeds or fails in a batch job. I found an easy way to accomplish my goal.

    First I created a DDM file on the production system to point to the target system.

    CRTDDMF FILE(MYLIB/MYDATA) RMTFILE(MYLIB/MYDATA) +
       RMTLOCNAME(DEVELOP *SNA)
    

    I chose to give the DDM file the same name as the production file. In this example, I use the file name MYDATA. So, DDM file MYLIB/MYDATA on the production system points to file MYLIB/MYDATA on system DEVELOP.

    To refresh the file on the development system requires me to run a simple Copy File (CPYF) command on the production system. Here I copy from the production database to the DDM file, selecting records in batch 151 only.

    CPYF FROMFILE(PRODUCTION/MYDATA) TOFILE(MYLIB/MYDATA) +
       MBROPT(*REPLACE) INCREL((*IF BATCH *EQ 151))
    

    Or, I can use the Copy from Query File (CPYFRMQRFY) command.

    OPNQRYF FILE((PRODUCTION/MYDATA)) QRYSLT('batch=170')   
    CPYFRMQRYF FROMOPNID(MYDATA) TOFILE(MYLIB/MYDATA) MBROPT(*REPLACE)
    CLOF OPNID(MYDATA)
    

    RELATED STORIES

    The Save-Restore Commands

    More About the SAVRSTxxx Commands

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    Cobalt Iron

    Smarter Data Protection with Cobalt Iron Compass

    Compass is the intelligent, cyber-secure data protection platform that supports all your workloads:

    • Cloud
    • On-premises
    • Hybrid

    Automate backup, outsmart ransomware, and scale effortlessly with a modern SaaS solution.  Compass delivers analytics-driven resilience built for ALL workloads – including IBM Power and IBM i.

    Modern protection.  Simplified delivery.  Try it free for 30 days.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    nuBridges:  Leading provider of secure FTP on the iSeries
    New Generation Software:  Leading provider of iSeries BI and financial management software
    COMMON:  Join us at the Spring 2007 conference, April 29 – May 3, in Anaheim, California

    The Web, the Workplace, and IBM’s Updated Content Management Software Bang for the Buck: Big Iron Boxes, Even Bigger Bucks

    Leave a Reply Cancel reply

Volume 6, Number 35 -- September 27, 2006
THIS ISSUE SPONSORED BY:

T.L. Ashford
WorksRight Software
Asymex

Table of Contents

  • Copy a Subset of Records from One System to Another
  • Stuffing Five Digits Into Four
  • Admin Alert: Setting the Record Straight on iSeries Access and ODBC Freeware

Content archive

  • The Four Hundred
  • Four Hundred Stuff
  • Four Hundred Guru

Recent Posts

  • EvolveWare Makes Progress With RPG Code Modernization Using AI
  • Why The IBM i Market Needed Another VTL Option
  • What Price Power?
  • Cloud Revenues Saved By The GenAI Boom
  • IBM i PTF Guide, Volume 27, Number 44
  • Power Systems Grows Nicely In Q3, Looks To Grow For All 2025, Too
  • Beta Of MCP Server Opens Up IBM i For Agentic AI
  • Sundry IBM i And Power Stack Announcements For Your Consideration
  • Please Take The IBM i Marketplace Survey
  • IBM i PTF Guide, Volume 27, Number 43

Subscribe

To get news from IT Jungle sent to your inbox every week, subscribe to our newsletter.

Pages

  • About Us
  • Contact
  • Contributors
  • Four Hundred Monitor
  • IBM i PTF Guide
  • Media Kit
  • Subscribe

Search

Copyright © 2025 IT Jungle