Hi All,
My apologies for the simple question. Never ksh scripted before... This is what I want to do. I have a file which calls forteen separate .dat files loading them to an Oracle DB.
Example of calling script:
#!/bin/ksh -p
IR_ROOT=/opt/app1/datasvr
date +'*** %c Started PDR DEV Loads ***'
cp $IR_ROOT/ndm_rcv/pdr_rcv/* $IR_ROOT/ndm_rcv/
$IR_ROOT/ca/bin/tscpe171 >> $IR_ROOT/log/tscpe171.log 2>&1 &
$IR_ROOT/ca/bin/tscpf171 >> $IR_ROOT/log/tscpf171.log 2>&1 &
wait
date +'*** %c Completed PDR DEV Loads ***'
Currently, I have to open each .dat file using vi and edit two dates.
Example below:
01,083009060,FORTE,040908,0354,1,80,1,2/
02,RCRV,083009060,1,040907,2359,USD,/
I want to store the dates to variables and pass them into each called file. I've created two variables in my calling script to hold dates.
Example...
IR_ROOT=/opt/app1/datasvr
date +'*** %c Started PDR DEV Loads ***'
cp $IR_ROOT/ndm_rcv/pdr_rcv/* $IR_ROOT/ndm_rcv/
curdate="040908"
prevdate="040907"
$IR_ROOT/ca/bin/tscpe171 >> $IR_ROOT/log/tscpe171.log 2>&1 &
$IR_ROOT/ca/bin/tscpf171 >> $IR_ROOT/log/tscpf171.log 2>&1 &
wait
date +'*** %c Completed PDR DEV Loads ***'
I want to pass the variables into each .dat file and process to Oracle. Here is what I have ...
01,083009060,FORTE,${currdate},0354,1,80,1,2/
02,RCRV,083009060,1,${prevdate},2359,USD,/
Is my syntax/thought process correct? Or do I need to add more logic. If so, can you provide a reference point.
TIA,
Tim
My apologies for the simple question. Never ksh scripted before... This is what I want to do. I have a file which calls forteen separate .dat files loading them to an Oracle DB.
Example of calling script:
#!/bin/ksh -p
IR_ROOT=/opt/app1/datasvr
date +'*** %c Started PDR DEV Loads ***'
cp $IR_ROOT/ndm_rcv/pdr_rcv/* $IR_ROOT/ndm_rcv/
$IR_ROOT/ca/bin/tscpe171 >> $IR_ROOT/log/tscpe171.log 2>&1 &
$IR_ROOT/ca/bin/tscpf171 >> $IR_ROOT/log/tscpf171.log 2>&1 &
wait
date +'*** %c Completed PDR DEV Loads ***'
Currently, I have to open each .dat file using vi and edit two dates.
Example below:
01,083009060,FORTE,040908,0354,1,80,1,2/
02,RCRV,083009060,1,040907,2359,USD,/
I want to store the dates to variables and pass them into each called file. I've created two variables in my calling script to hold dates.
Example...
IR_ROOT=/opt/app1/datasvr
date +'*** %c Started PDR DEV Loads ***'
cp $IR_ROOT/ndm_rcv/pdr_rcv/* $IR_ROOT/ndm_rcv/
curdate="040908"
prevdate="040907"
$IR_ROOT/ca/bin/tscpe171 >> $IR_ROOT/log/tscpe171.log 2>&1 &
$IR_ROOT/ca/bin/tscpf171 >> $IR_ROOT/log/tscpf171.log 2>&1 &
wait
date +'*** %c Completed PDR DEV Loads ***'
I want to pass the variables into each .dat file and process to Oracle. Here is what I have ...
01,083009060,FORTE,${currdate},0354,1,80,1,2/
02,RCRV,083009060,1,${prevdate},2359,USD,/
Is my syntax/thought process correct? Or do I need to add more logic. If so, can you provide a reference point.
TIA,
Tim