• 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
    Computer Keyes

    Fax Directly from your IBM i

    KeyesFax is a full function automated IBM i fax system. Spooled files are burst by fax number and auto transmitted with overlays.  It combines both a send and receive facsimile processing system with a complete image package.

    The fax software will edit, send, receive, display, print, and track fax documents or images using any standard IBM i without additional expensive hardware, software or subscriptions.

    Computer Keyes has been developing Software Solutions since 1978!

    www.computerkeyes.com

    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

  • With Power11, Power Systems “Go To Eleven”
  • With Subscription Price, IBM i P20 And P30 Tiers Get Bigger Bundles
  • Izzi Buys CNX, Eyes Valence Port To System Z
  • IBM i Shops “Attacking” Security Concerns, Study Shows
  • IBM i PTF Guide, Volume 27, Number 26
  • Liam Allan Shares What’s Coming Next With Code For IBM i
  • From Stable To Scalable: Visual LANSA 16 Powers IBM i Growth – Launching July 8
  • VS Code Will Be The Heart Of The Modern IBM i Platform
  • The AS/400: A 37-Year-Old Dog That Loves To Learn New Tricks
  • IBM i PTF Guide, Volume 27, Number 25

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