Home |

REORG - UNIX

In order to determine the files that have errors:

Type ls-la *.er

    # ls -la *.er
    -rw-rw-rw-
    1 root  other 68 May 10 11:47  prtass.er

Type reorg (filename with no extension)
Press <ENTER>

    -rwxrwxrwx 1 root other 2048 Apr 23 2001 prtass.nx
    -rwxrwxrwx 1 root other 8192 May 2 09:05 prtass.xd
    UX:rm: ERROR: Cannot access t.xd: No such file or directory
    UX:rm: ERROR: Cannot access t.nx: No such file or directory
    icreorg Revision 3.00 (DG/UX for 88K)
    Copyright (C) 1987-2000, Egan Systems, Inc. All rights reserved.
    /stage/mcoffice/mcadata/t reorganized into /stage/mcoffice/mcadata/prtass on
    May-10-2002 11:47:47.82
    Input file type: Indexed (processed by primary key)
    Records processed: 81
    Output file type: Indexed
    Records written: 81
    Records ignored: 0
    icreorg is finished
    iccheck Revision 3.00 (DG/UX for 88K)
    Copyright (C) 1987-2000, Egan Systems, Inc. All rights reserved.
    /stage/mcoffice/mcadata/prtass processed on May-10-2002 11:47:48.60
    ICISAM Revision 5.09
    Delete is logical, Maximum file size is 2GB
    No Alternate Keys 64 byte Records 81 Records allocated
    Records available before the .XD EOF: 109
    Primary ------- Key: 81 Record: 81
    1 file/argument was processed - All are reliable.
    iccheck is finished
    #

The reorg process should indicate that it terminated successfully. The chkisam process will follow and should indicate that zero files had errors.

The reorg procedure will display a counter as it reads records and writes them out to the file. After the reorg is finished, you should be able to continue with normal operations. If you have any errors after the reorg, you will need to call MC for further assistance.


REORG SCRIPTS

reorg

This is the reorg script file used for UNIX.

    umask 000
    ICTERM=dg
    ICROOT=/mc/cobol
    export ICTERM ICROOT

    if [ -f $1.xd ]
     then
        ls -la $1.*
    else
        echo "This file does not exist"
        exit
    fi
    rm t.xd
    rm t.nx
    mv $1.xd t.xd
    mv $1.nx t.nx

    /mc/cobol/icreorg -p t $1
    /mc/cobol/iccheck -epiN w $1

    exit

reorgall

This is the script that is used for the full system cleanup.

    umask 000
    PATH=.:/mc/cobol/:$PATH
    ICCODEPATH=/mc/mcaobj
    ICTERM=dg
    ICROOT=/mc/cobol
    export ICTERM ICCODEPATH ICROOT PATH

    dir=`pwd`
    echo "Reorging all files in $dir"

    ls > mca1.temp
    fgrep '.nx' mca1.temp > mca.temp
    paste -s mca.temp>mca.temp1
    read MCA<mca.temp1

    for i in $MCA; do
    ls $i|cut -d. -f1 > ftemp
    read FILE<ftemp
    echo
    echo $FILE
    echo
    mv $FILE.xd t.xd
    mv $FILE.nx t.nx

    /mc/cobol/icreorg -pV 5 t $FILE
    if [ -f "$FILE.xd" ]
    then echo "REORG COMPLETE ON $FILE"

    else echo "REORG FAILED ! on $FILE"
    mv t.xd $FILE.xd
    mv t.nx $FILE.nx
    ls $FILE.xd >> reorg.log
    fi

    # chkisam $FILE
    done
    rm ftemp
    rm t.*
    rm mca.temp*
    rm mca1.temp

Updated on February 18, 2005 at 11:00 a.m.