the cia was only formally established in 1947 by the national security act of 1947 , although it 's precursor organization , the office of strategic services ( oss ) was created in during world war ii , in june of 1942 .