Unix script enhancement


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unix script enhancement
# 8  
Old 10-26-2010
Running multiple shell scripts all at once

Hello,
I have 5 .sh scripts, each for Claims, Provider, Condition, Encounter, Procedure.
I want to run these all, by combining them all into one shell script.
It basically loads the data from the .csv file to the table in Oracle.

Note: I have set the oracle environment only once for all the scripts. But when i try to run the shell script,, it picks up only one and throws the output. I want the script to execute all the scripts, and then give the output.

Hope i am clear.
Please help me out with this..

Thanks in advance
Rahman



---------- Post updated 10-26-10 at 11:16 AM ---------- Previous update was 10-25-10 at 05:04 PM ----------




Can anyone pls reply back to this? Its urgent. I am struck in the middle of noway.
Appreciate your help..
# 9  
Old 10-26-2010
How are you running these 5 scripts, can you post your script.

What output are you getting? Could it be that the last script run is overwriting the output file of the one before it?
# 10  
Old 10-26-2010
Are there high-level data-dependencies enforced by constraints, like loading providers before claims else claims cannot insert unknown provider?
# 11  
Old 10-26-2010
Quote:
Originally Posted by Chubler_XL
How are you running these 5 scripts, can you post your script.

What output are you getting? Could it be that the last script run is overwriting the output file of the one before it?
_____________________________________________________________
Here's one the script which is for "" that is included in the file name "sqlldrclaims.sh".

Code:
#Claims
/usr/local/pl/util_scripts/perlencrypt.pl -k /export/home/oracle/secure/ealgorithm -d /sdr1/system/$pwd_file | sqlldr $userName control=/space/dbexport/PHR/c
ontrol/claims.ctl log=/space/dbexport/PHR/log/claims-`date +%Y%m%d`.log bad=/space/dbexport/PHR/bad/claims-`date +%Y%m%d`.bad
rc=$?
if [ $rc == 2 ]
then
echo 'Claims table load finished with warnings/errors'
mv /space/dbexport/PHR/data/claimExport.csv /space/dbexport/PHR/archive/claimExport-`date +%Y%m%d`.csv
chmod 640 /space/dbexport/PHR/archive/claimExport-`date +%Y%m%d`.csv
exit $rc
elif [ $rc == 0 ]
then
echo 'Claims table load Successful'
#mv /space/dbexport/PHR/data/claimExport.csv /space/dbexport/PHR/archive/claimExport-`date +%Y%m%d`.csv
#chmod 640 /space/dbexport/PHR/archive/claimExport-`date +%Y%m%d`.csename=`basename $logfile`
exit $rc
else
echo 'Claims table load Failed -- Return Code='$rc
exit $rc
fi

I have 4 more of these scripts that are in "sqlldrclaims.sh" script.
Code:
Condition
Encounter
Procedure
Provider.

When i execute the script..... its loads the Claims data, and then it stops.
It does not move (go ahead) to the next script (i.e Condition and then to encounter, and so on).

I need this script to run for all the 5 and give the output.

Any help would appreciate it.

Regards
Rahman



---------- Post updated at 01:51 PM ---------- Previous update was at 01:50 PM ----------




Quote:
Originally Posted by DGPickett
Are there high-level data-dependencies enforced by constraints, like loading providers before claims else claims cannot insert unknown provider?
_____________________________________________________________

Not that i know of.
No high-level data-dependencies are enforced here.

Regards.
Rahman

Last edited by Scott; 10-26-2010 at 06:08 PM.. Reason: Code tags
# 12  
Old 10-26-2010
Are they all loading different tables from different files using sqlldr?
# 13  
Old 10-26-2010
Here's a sqlldr file for Claims

Code:
LOAD DATA
infile '/space/dbexport/PHR/data/claimExport.csv'
APPEND INTO TABLE CLAIM
FIELDS TERMINATED BY "|" OPTIONALLY ENCLOSED BY '"' TRAILING NULLCOLS
(SID CHAR,
HICN CHAR,
ICNDCN CHAR,
ORIGCLAIMID CHAR,
LOB CHAR,
PDFINDATE DATE "MM/DD/YYYY")

Each sqlldr files for each file
Code:
LOAD DATA
infile '/space/dbexport/PHR/data/procedureExport.csv'
APPEND INTO TABLE PROCEDURE

HTH

Last edited by Scott; 10-26-2010 at 06:09 PM.. Reason: Code tags
# 14  
Old 10-26-2010
How does it run now? Interactively? One script at a time?

Have you determined if it stops at the end of the first sqlldr, not the beginning of the second?
Login or Register to Ask a Question

Previous Thread | Next Thread

3 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pagination need enhancement.

I have below folder structure . |--summit | |----xpnldetails | |----trades | |----svar | | |------checksum | |----xpnl | |----adjustment | | |------summit | | |------ap | |----risks | |----hypopnl | |----fxeffect | |----audittrail |... (0 Replies)
Discussion started by: manas_ranjan
0 Replies

2. UNIX for Dummies Questions & Answers

Linux Multipath Enhancement

Hi.. when i delete a Lun from a Array on a SAN, and again when i create a Lun it shows that the newly created Lun has the ID of the Old deleted Lun which is leading to data corruption. All this is handled by the Multipath software. can anybody help. (0 Replies)
Discussion started by: Praveen13
0 Replies

3. UNIX for Advanced & Expert Users

Linux Multipathing Enhancement

We are searching for DEVICE MAPPER TABLE FORMAT and how to access it through user space?? We are working on enhancement in multipatrhing as 1] scalable path testing 2] event mechanism 3] i/o load sharing. So we need to access device info as well as all paths to that device, devices status,paths... (1 Reply)
Discussion started by: rajaryan99
1 Replies
Login or Register to Ask a Question