what is the use of a resistor in the PNP transistor?
1) R3 limits the current flowing through the base of the transistor and helps protect the microcontroller pin. You can find more information on base resistors here:

http://www.evilmadscientist.com/2013/base-resistor/

2) When the PIC is sourcing current, the PNP transistor will be switched off, and no current (in theory) will be flowing through it (or through the base). This is based on the PNP theory of operation. The PNP will be switched off when the PIC pulls its base HIGH, and switched on when the PIC sinks the current from the base.