The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #5 (permalink)  
Old 10-15-2008
SpiralSpastic SpiralSpastic is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 4
Current file is APPLIC.YYYYMMDD and it will copied to APPLIC.TMP before I run the process CEDP3100 that will read APPLIC.TMP to verify the file.

I've already amend CEDP3100 core process to verify the file APPLIC.TMP and APPNFC.TMP. So how I need to do for amend existing script to add for read new file APPNFC.YYYYMMDD so i can convert to APPNFC.TMP and after that the core process (CEDP3100) will read both file and verify it. After that I need to convert back APPLIC/APPNFC .TMP back to APPLIC.INC and APPNFC.INC. I've thinking for while loop to process the file, but i need any suggestion that can change the original coding.


Code:
#==========================
function DO_ELOAN_FILES
#==========================
{
    echo "Processing Eloan Files (APPLIC) ..."
     if test -s $importdir/nonfin/APPLIC* //read APPLIC.YYYYMMDD
     then
        > APPLIC.INC 
        for incfl in $importdir/nonfin/APPLIC*
        do

          if test -s $incfl
          then
             cp $incfl APPLIC.TMP //copied the APPLIC.YYYYMMDD to .TMP file
             CEDP1300 //core process to verify the file
             if [ $? -eq 0 ] // if successful
             then
                cat APPLIC.INC $incfl > tmpincfl
                mv tmpincfl APPLIC.INC
                rm -f $incfl
             else
                mv $incfl ../errfiles/ //if failed
                echo "Eloan Files (APPLIC) Pre-edit failed!!!"
             fi
      else
        echo "ELoan Files (APPLIC) is empty"
        echo "ELoan Files (APPLIC) is empty" >> EDPIMPORT.LST
          fi
        done
        rm APPLIC.TMP
        echo "Eloan Files (APPLIC) successfully copied."
        echo "Eloan Files (APPLIC.INC) successfully copied." >> EDPIMPORT.LST
        echo >> EDPIMPORT.LST
     else
        echo "Eloan (APPLIC) Files not found."
        echo "Eloan (APPLIC) Files (APPLIC.INC) not found." >> EDPIMPORT.LST
        echo >> EDPIMPORT.LST
     fi
     echo

}

I've put some comment in RED for Mr.Johnson to under stand the situation