1849206 Members
7210 Online
104041 Solutions
New Discussion

Re: Suggestion Needed.

 
uform
Frequent Advisor

Suggestion Needed.

Hi,

At the end of our monthly process, we will be sending out nearly 45 extract files (spool file from oracle) to various teams for their process. End of day it will be 45 Flat files in Unix, which needs to be compared with last month file's record count etc...

Now we would like to introduce a "Check Job" before sending out files to our users.

Like no of records is atleast 6% more from last month's file etc.. Because due to some issues sometimes files goes out empty or incomplete.

Can anyone suggest a good methodology to do this? all these jobs (45-50 jobs) run in autosys and NDM / FTP out the files to users.

Is there any command to see the percentage difference between 2 files ? (using unix shell - preferred)

We are trying to avoid adding 50 check jobs before the NDM / FTP job...trying to identify the best method to handle this.

PLS HELP. Thanks

2 REPLIES 2
Ivan Ferreira
Honored Contributor

Re: Suggestion Needed.

Maybe you can use the diff command to identify the lines different from one file and another. Half of the output returned by diff are the lines of the new file, if you redirect this to a file, then you can compare the size of the resulting file with the original file and, using bytes, calculate the percentage of difference, or using wc, calculate the number of lines different.

Cheers.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Steven E. Protter
Exalted Contributor

Re: Suggestion Needed.

Shalom,

You will need some kind of script.

lastmonthvalue=$(ls -l filename | awk '{ print $4 }')

thismonthvalue=$(ls -l filename | awk '{ print $4 }')

Then calcuate the difference in size.

ls -1 can produce a file list for processing in a while loop.

I'm not going to write it for you, but thats how I'd go about it.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com