In this paper we give an alternative proof of some of these results. Our approach is based on permutation codes which, like the Lehmer code, map bijectively permutations onto subexcedant sequences. More precisely, we give several code transforms (i.e.,?bijections between subexcedant sequences) which when applied to the Lehmer code yield new permutation codes which count occurrences of some vincular patterns. These code transforms can be seen as a pre-compression step of the Lehmer code because they map some redundancies into runs of 0s. Also, our proofs, unlike the previous ones, provide explicit bijections between permutations having a given value for two different Mahonian pattern-based statistics.