With the war over, in 1919 he entered the civil service without competition and was appointed a junior solicitor to the Ministry of Labour. He succeeded Clive Lawrence as the Ministry's solicitor in 1923 and two years later joined the Office of the Parliamentary Counsel as Third Parliamentary Counsel; he was promoted to Second Parliamentary Counsel in 1929 but was overlooked when Sir Maurice Gwyer was appointed from outside the office as First Parliamentary Counsel in 1933. Ram was, however, promoted when Gwyer resigned in 1937 and served as First Parliamentary Counsel until his own retirement in 1947. Ram's work in the OPC encompassed a range of important acts. He was responsible for drafting the Trade Disputes Act 1927; under Gwyer, he was allowed to draft a number of acts alone, including the Unemployment Act 1934 and the Public Order Act 1936; he worked with his superior on the Abdication Act 1936, which allowed Edward VIII to abdicate. As First Parliamentary Counsel, he drafted wartime legislation, most notably the Emergency Powers Act 1940, and the landmark Education Act 1944; for the first two years of the Attlee government, Ram was responsible for overseeing its sweeping reforms turned into legislation. He was also keen to reform and consolidate statute law and, on retirement from the OPC in 1947, he served until his death as Chairman of the Statute Law Committee and was responsible for 29 consolidation acts after the committee was given new powers to recommend minor amendments. According to Jason Tomes writing in the Oxford Dictionary of National Biography, Ram was "perhaps less scholarly and certainly more rumbustious than the typical parliamentary counsel"; he ran the OPC like his own chambers, and was defensive of his staff to outside criticism, but could be highly critical himself, if also keen to help their careers. The "dominant figure" in the OPC for many years, he was appointed a Companion of the Order of the Bath in 1931 and promoted to Knight Commander seven years later. Outside of the OPC, Ram was a magistrate for Hertfordshire from 1923, and was Chairman of the county's Quarter Sessions from 1946 until his death. He was appointed a King's Counsel in 1943 and served as a Church Commissioner after 1948. He died on 23 December 1952, leaving a widow and five children.