mgo
OS/400 Edition
Volume 2, Number 50 -- June 28, 2002

Distinct File and Record Names with SQL


Hey, Ted:

When I create a physical file using the SQL CREATE TABLE command, the system gives the same name to the file and record format.


This means that I have to remember to rename the record format in every RPG program I write that defines the file in an F spec. Is there a way to make SQL give the record format some other name?

-- Dan


I know of one way.

Let's say you want to create a file called MYFILE in library MYLIB and name the record format MYREC.

Run the following SQL commands in an interactive SQL session.



create table mylib/myrec (
   name char (20),                  
   number dec (5))                  

rename table mylib/myrec to myfile


The physical file will be renamed to MYFILE, but the record format name will remain MYREC.

-- Ted


Sponsored By
CENTERFIELD TECHNOLOGY

Take the guesswork out of iSeries DASD Management with disk/HUNTER

Why wait until your system slows down or stops because a run-away query eats up your disk space?

Many application and database problems can lead to disk spikes, including:

  • Database queries that create large, temporary indexes (access paths)
  • Database queries that create large temporary spaces to implement hash joins or grouping
  • Applications that use heap storage but do not free it (memory leaks)
  • Java-based applications that create a large number of objects but that do not get reclaimed because of dangling object references
  • Applications that use the Integrated File System (IFS) and create large stream files but do not always delete them when they are done
  • Users who create copies of data in IFS as backups not realizing how much disk space they consume
  • Jobs caught in an infinite loop writing printing and creating very large spool files
  • Applications that write to log files that do not get cleared often or at all
  • Data collected by IBM performance and trace tools

Once installed and configured, disk/HUNTER runs continuously in the background on your AS/400 iSeries, and “wakes up” at intervals that you specify. Every time disk/HUNTER wakes up, it will measure the amount of free space remaining within specified ASPs or all ASPs.

When the amount of free space decreases by a user-specified percentage or by a user-specified amount (in megabytes or gigabytes), disk/HUNTER will go to work, generating messages and reports pointing to the origination of the spike.

The combination of detection and diagnostic capabilities within disk/HUNTER provides a powerful element of control to iSeries shops that experience high levels of activity and that also need to be proactive in managing storage.

To really see how disk/HUNTER can be both an insurance policy and a time-saver in your shop, click here to download a demo or order a no-charge 30-day support-assisted trial evaluation.


THIS ISSUE
SPONSORED BY:

Advanced Systems Concepts
Centerfield Technology


BACK ISSUES

TABLE OF CONTENTS

Easy Subfile Windowing

Distinct File and Record Names with SQL

Reader Feedback and Insights: Determining Whether a User Is Already Signed On, Take Three



Editors
Howard Arner
Joe Hertvik
Ted Holt
David Morris

Managing Editor
Mari Barrett

Contact the Editors
Do you have a gripe, inside dope or an opinion?
Email the editors:
editors@itjungle.com



Last Updated: 6/28/02
Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.