• The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
Menu
  • The Four Hundred
  • Subscribe
  • Media Kit
  • Contributors
  • About Us
  • Contact
  • Alternatives to Clear Physical File Member

    February 1, 2006 Ted Holt

    Suppose a file of summary figures is used for inquiry throughout the day and is repopulated with the latest information on the hour. How do you clear the file, a process which requires an exclusive lock, while the inquiry program is in use? This is the type of problem I have faced several times, and here are a couple of ways I have addressed it.

    One method is to place an activity code field in the file, with values of A and D, for example, to indicate active and deleted records. The inquiry program uses a logical file to select active records only.

    A          R SOMEREC                   PFILE(SOMEPF)
    A          K CUSTNO                                     
    A          K TRANSDATE                                  
    A          S RECCODE                   CMP(EQ 'A')
    

    Reloading the file is a two-step process: First, change the activity code to the deletion value. Second, write new data to the file.

    The other method I have used is similar, but does not require the file to have an activity field. This method is also a two-step process. First, delete all the records in the file. You might use a generic program, like this one:

     * Delete all records in a file
    FDBFile    UF   F   80        DISK
    DDS               DS            80
    
    C              DOU     *INLR
    C              READ    DBFile       DS          LR
    C              IF      NOT *INLR
    C              DELETE  DBFile
    C              ENDIF
    C              ENDDO
    

    Or, if you prefer shorter programs, this one:

     * Delete all records in a file
    FDBFile    up   f   80        disk
    IDBFile    ns  01
    ODBFile    ddel 01
    

    Before calling the program, override to the file whose records are to be deleted.

    OVRDBF FILE(DBFILE) TOFILE(SALES)
    CALL   PGM(DLTRCDS)
    DLTOVR FILE(DBFILE)
    

    Second, write new data to the file.

    In either case, the file accumulates more and more physically or logically deleted records throughout the day. At some point, such as during nightly or weekend processing, the file will need to be cleared.

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Tags:

    Sponsored by
    WorksRight Software

    Do you need area code information?
    Do you need ZIP Code information?
    Do you need ZIP+4 information?
    Do you need city name information?
    Do you need county information?
    Do you need a nearest dealer locator system?

    We can HELP! We have affordable AS/400 software and data to do all of the above. Whether you need a simple city name retrieval system or a sophisticated CASS postal coding system, we have it for you!

    The ZIP/CITY system is based on 5-digit ZIP Codes. You can retrieve city names, state names, county names, area codes, time zones, latitude, longitude, and more just by knowing the ZIP Code. We supply information on all the latest area code changes. A nearest dealer locator function is also included. ZIP/CITY includes software, data, monthly updates, and unlimited support. The cost is $495 per year.

    PER/ZIP4 is a sophisticated CASS certified postal coding system for assigning ZIP Codes, ZIP+4, carrier route, and delivery point codes. PER/ZIP4 also provides county names and FIPS codes. PER/ZIP4 can be used interactively, in batch, and with callable programs. PER/ZIP4 includes software, data, monthly updates, and unlimited support. The cost is $3,900 for the first year, and $1,950 for renewal.

    Just call us and we’ll arrange for 30 days FREE use of either ZIP/CITY or PER/ZIP4.

    WorksRight Software, Inc.
    Phone: 601-856-8337
    Fax: 601-856-9432
    Email: software@worksright.com
    Website: www.worksright.com

    Share this:

    • Reddit
    • Facebook
    • LinkedIn
    • Twitter
    • Email

    Sponsored Links

    Computer Keyes:  Rapidly convert *SCS printer files into black and white or full color PDF documents
    Cosyn Software:  Audit Trail/400 for Sarbanes Oxley
    COMMON:  Join us at the Spring 2006 conference, March 26-30, in Minneapolis, Minnesota

    Avnet, Lakeview Partner on iSeries High Availability Feeds and Speeds of the New System i5s

    Leave a Reply Cancel reply

Volume 6, Number 2 -- February 1, 2006
THIS ISSUE SPONSORED BY:

WorksRight Software
Advanced Systems Concepts
COMMON

Table of Contents

  • A FUNction to Align Text
  • Alternatives to Clear Physical File Member
  • Admin Alert: Six Simple Rules for OS/400 Group Profiles
  • Alternate SQL Row-Selection Criteria, Take 3
  • Indicate Negative Numbers with Parentheses
  • Admin Alert: Limiting *PUBLIC Access to i5/OS Objects, Part 2

Content archive

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

Recent Posts

  • 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
  • Meet The Next Gen Of IBMers Helping To Build IBM i
  • Looks Like IBM Is Building A Linux-Like PASE For IBM i After All
  • Will Independent IBM i Clouds Survive PowerVS?
  • Now, IBM Is Jacking Up Hardware Maintenance Prices
  • IBM i PTF Guide, Volume 27, Number 24

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