• 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
    DRV Tech

    Get More Out of Your IBM i

    With soaring costs, operational data is more critical than ever. IBM shops need faster, easier ways to distribute IBM applications-based data to users more efficiently, no matter where they are.

    The Problem:

    For Users, IBM Data Can Be Difficult to Get To

    IBM Applications generate reports as spooled files, originally designed to be printed. Often those reports are packed together with so much data it makes them difficult to read. Add to that hardcopy is a pain to distribute. User-friendly formats like Excel and PDF are better, offering sorting, searching, and easy portability but getting IBM reports into these formats can be tricky without the right tools.

    The Solution:

    IBM i Reports can easily be converted to easy to read and share formats like Excel and PDF and Delivered by Email

    Converting IBM i, iSeries, and AS400 reports into Excel and PDF is now a lot easier with SpoolFlex software by DRV Tech.  If you or your users are still doing this manually, think how much time is wasted dragging and reformatting to make a report readable. How much time would be saved if they were automatically formatted correctly and delivered to one or multiple recipients.

    SpoolFlex converts spooled files to Excel and PDF, automatically emailing them, and saving copies to network shared folders. SpoolFlex converts complex reports to Excel, removing unwanted headers, splitting large reports out for individual recipients, and delivering to users whether they are at the office or working from home.

    Watch our 2-minute video and see DRV’s powerful SpoolFlex software can solve your file conversion challenges.

    Watch Video

    DRV Tech

    www.drvtech.com

    866.378.3366

    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

  • FAX/400 And CICS For i Are Dead. What Will IBM Kill Next?
  • Fresche Overhauls X-Analysis With Web UI, AI Smarts
  • Is It Time To Add The Rust Programming Language To IBM i?
  • Is IBM Going To Raise Prices On Power10 Expert Care?
  • IBM i PTF Guide, Volume 27, Number 20
  • POWERUp 2025 –Your Source For IBM i 7.6 Information
  • Maxava Consulting Services Does More Than HA/DR Project Management – A Lot More
  • Guru: Creating An SQL Stored Procedure That Returns A Result Set
  • As I See It: At Any Cost
  • IBM i PTF Guide, Volume 27, Number 19

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