Home > AS/400 Tips > iSeries administrator tips > Dynamically reorganizing DB2 files -- Take 2
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES ADMINISTRATOR TIPS

Dynamically reorganizing DB2 files -- Take 2


Mary Milliron
04.23.2001
Rating: -3.33- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Just an update to Peter Codispoti's fine tip. I've just combined his three programs into one -- similar to a program that we use.

I'm sure if we had the time, we could all look back at the multitude of utilities that we've written and update the heck out of them -- especially with the improvements/enhancements that IBM has made to OS/400 over the years. It's just amazing to me that we have programs and objects from the early 1980's that are still in use on our system today. Thanks IBM!

           /******************************************************************/
           /*  PROGRAM: REORG                                                */
           /*  PURPOSE: CREATE A LIST OF FILES/MEMBERS.  THEN CALL SYGMBR2   */
           /*           WHICH WILL LOOK FOR DELETED RECORDS.  IF DELETED     */
           /*           RECORDS EXIST FILE MEMBER WILL BE REORGANIZED.       */
           /*           FILE NAME: QGPL/SYPMBR CREATED BY DSPFD CMD          */
           /*                                                                */
           /*   NOTE -- THIS PROGRAM MUST BE COMPILED WITH OBJECT AUTH.      */
           /*           OF *OWNER.                                           */
           /*                                                                */
           /*       BY: PETE CODISPOTI   9/16/97                             */
           /*                                                                */
           /******************************************************************/
             PGM
             DCL        VAR(&JOBQ) TYPE(*CHAR) LEN(10)
             DCLF       FILE(QGPL/SYPMBR)
             MONMSG     MSGID(CPF9999)

 BEGIN:      DSPFD      FILE(AM2000/*ALL) TYPE(*MBRLIST) +
                          OUTPUT(*OUTFILE) FILEATR(*PF) +
                          OUTFILE(QGPL/SYPMBR)
                    .
                    .
                    .

 LOOP:       RCVF
             MONMSG     MSGID(CPF0864) EXEC(GOTO CMDLBL(ENDALL))

             IF         COND(&MLNDTR *EQ 0) THEN(GOTO CMDLBL(LOOP))

             IF         COND(%SST(&MLFILE 1 2) *EQ 'AM') THEN(CHGVAR +
                          VAR(&JOBQ) VALUE('QBATCH'))
                    .
                    .
                    .

             SBMJOB     CMD(RGZPFM FILE(&MLLIB/&MLFILE) MBR(&MLMBR)) +
                          JOB(&MLFILE) JOBD(MNHJOBD) JOBQ(&JOBQ)
             MONMSG     MSGID(CPF0000)

             GOTO       CMDLBL(LOOP)

 ENDALL:     ENDPGM 

Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Integrated File System (IFS)
How to view source files in the library
User being locked out by Windows share on iSeries
Incorrect CCSID on FTP connection from AS/400 to Windows
Trouble accessing IFS path from Win2k3 server
How to use an API for adding users to EIM SSO implemenation
Transfer files from one environment to another without closing all other AS/400 sessions
Securing the integrated file system on IBM System i
Generically send a text file from the IFS via FTP
Setting ILE and C+++ compilers to runtime
Use a virtual directory to move a .bmp file from the IFS to a remote server to run a software package

DB2 UDB for iSeries
Expert advice on DB2
Make your database easy to read
Top 10 tips from our experts
DB2 expert Kent Milligan offers advice
Schedule stored procedures in DB2 UDB
Special features make creating tables simple
How to use DB2's cross-reference files to help manage your database -- Part II
How to use DB2's cross-reference files to help manage your database -- Part I
Revisit your database naming conventions
DB2/400 and DB2 UDB

iSeries administrator tips
Translating Linux for IBM i admins: Using GUI to make it easy
Translating Linux for IBM i admins: Working with jobs and networking
OpenOffice: What to know before making the transition from Microsoft Office
OpenOffice: An enterprise open source solution
Database performance comparisons on IBM i
Translating Linux for IBM i admins: User profile commands
Modern System i reports using Client Access
Tips for installing Lotus Domino server on a System i partition
The iSeries Blog has a new home on IT Knowledge Exchange
Virtualization for IBM i: Backups

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts