Arduino Mega 2560 interrupt pins and port mapping with rotary encoder
Re “pins 2 and 3 are different. I think on the Mega they are PORTH3 and PORTH4 respectively”, it's true that Arduino digital pins 2 and 3 belong to different ports on Uno vs Mega2560 boards.

Mega2560's have six INTx pins, vs two such on Uno's.  On the Mega, INT0...INT3 are PD0...PD3, and INT4,INT5 are PE4,PE5.  On the Uno, INT0,INT1 are PD2,PD3.  Note, in an answer at Can external interrupts be OR'd together on the '328 (Uno)? I show a couple of routines that will display appropriate masks for pins on different Arduinos.  See the sections “Using other pins for PCIs” and “ISR-framework-generating Sketch”.



Here are a few problems with the code shown in the question:


aFlag is initialized to zero, and is never set nonzero in the code shown.  So the first if condition in PinA() is never met.
PinA() is an interrupt handler, connected to interrupts by your attachInterrupt() calls.  Because hardware disables interrupts before it enters an interrupt handler, there is no need for the interrupt handler to turn off interrupts.  That is, delete cli() in PinA().  Similarly, delete the sei() at the end of PinA() because hardware restores interrupt status when a RETI instruction executes.
The Arduino software environment defines constants like B00001100 with binary values that match the name.  That is, in the Arduino software environment, constant B00001100 has the value 0B00001100.  In my opinion, that's a stupid and unnecessary feature; I suggest that in your code you use standard C notation like 0B00001100 when you want to use binary constant values.
I regard writing encoderPos -- instead of encoderPos-- as a perversion and suggest deleting that unnecessary space.
As you haven't shown the PinB() interrupt handler, I don't know how you were going to handle the encoderPos++ case.  Judging from the code shown, you are using a method that won't correctly handle bounce and intermittent errors.  I suggest using pin-change interrupts and a state-machine method, as illustrated in answers to:
• Reading from a KY-040 rotary encoder with Digispark
• How to read RPS for fast rotation with status change method in Arduino?
• Read RC receiver channels using Interrupt instead of PulseIn
• Can external interrupts be OR'd together on the '328 (Uno)?