passing awk variable to the shell script

hi;

i have a file containing lines like:

1|1069108123|96393669788|00963215755711|2|0|941||;serv:Pps6aSyria;first:0;bear

i want to extract the second, third and fourth record of each line and store it in a file ";" seperated

this is what i wrote

while read line
do
A_party=`echo $line |awk -F["|"] '{print $3}'`
B_party=`echo $line |awk -F["|"] '{print $4}'`
time=`echo $line |awk -F["|"] '{print $2}'`

            echo $A\_party";"$B_party";"$time >> $_outfile
    done < $_infile 

But the problem is that i am calling three times awk for each line, how can i pass awk variable to the script in order to call awk only one time.

Thanks in advance.:confused:

An awk one liner should do the trick for the whole set of data

awk -F'|' '{printf( "%s;%s;%s\n", $2, $3, $4 ) >> "outfile" }' infile

Cheers
ZB

Or

awk 'BEGIN{FS="|";OFS=";"}{print $2,$3,$4}' infile > outfile

Thanks a lot both worked fine.

question, how can i pass let's say $2 to the script in case i will need it in other place of the script.
remember the subject of my thread.

thanks a lot for your help guys.