As far as the Shelf position question, here's the definitive explanation. Let's take your example, A27 (2) 2-1-2. For the purpose of this demonstration, we'll assume that ALL aisles in the store are made up of 6 four foot sections, for a total of 24 feet. This is not actually true, you'll probably notice that your store's grocery aisles are made up of 9 four foot sections, your stationary and housewares is made of 5 four foot sections, etc. It will vary. But for simplicity's sake, A27 has 6 four foot sections.
You scanned an item telling you A27 (2) 2-1-2. That item's planogram starts in section 2, or the second four foot section. This is where you start counting the next number, which is also a section number. The reason there are two section numbers is because the first one, in parentheses, tells you which physical section of the gondola the planogram starts in, and the second number is the section of that planogram that the shelf you want resides in. Then the next number is the shelf, starting with the basedeck and counting upwards. If you see A27 (2) 2-P1-2, the P indicates that it is a pegged item instead of one sitting on a shelf. Finally, the last number indicates the position on the shelf, starting from the left.
As Scram mentioned, there are specialty physical section numbers. If the number in parentheses is (0), this means an endcap. An ODD aisle number with a (0) means the FRONT endcap, and an EVEN aisle number means the BACK endcap (A27 vs A28). Remember that most items that are on an endcap also have a home location somewhere in an aisle (inline). A physical section number (99) means the item is on a sidecap, which is a small fixture holding a few impulse buys on the side of a gondola near the front or back endcap. If you want a good example, all those battery centers scattered throughout the store are sidecaps.
-Technical note: A planogram is sort of a diagram or protocol for how a part of an aisle is going to be laid out. It shows exactly how the shelves, pegs, and other fixtures are set, and also links every item that belongs there to it. Not all planograms are exactly 24 feet. Some are 4 feet, some are 8 feet, and so on. There can be 3 or 4 different planograms in one aisle to make up the total 24 feet. This is why the (2) exists. This is telling you that a new planogram is starting in physical section 2 of the aisle.
Now then, as to your other question, it sounds like you were breaking out pallets from your food load. This is best practice, though sometimes stores will skip it. If you look above the line there should be brightly colored pieces of paper above each space where a flat is parked that show what kind of food belongs on that flat. It's totally up to how your store is set up, and if they don't have those papers there, then ask around until you get familiar with the food breakout process at your store.