The QCD axion solving the strong CP problem may originate from antisymmetric tensor gauge fields in compactified string theory, with a decay constant around the GUT scale. Such possibility appears to be ruled out now by the detection of tensor modes by BICEP2 and the PLANCK constraints on isocurvature density perturbations. A more interesting and still viable possibility is that the string theoretic QCD axion is charged under an anomalous U(1)_A gauge symmetry. In such case, the axion decay constant can be much lower than the GUT scale if moduli are stabilized near the point of vanishing Fayet-Illiopoulos term, and U(1)_A-charged matter fields get a vacuum value far below the GUT scale due to a tachyonic SUSY breaking scalar mass. We examine the symmetry breaking pattern of such models during the inflationary epoch with the Hubble expansion rate 10^{14} GeV, and identify the range of the QCD axion decay constant, as well as the corresponding relic axion abundance, consistent with known cosmological constraints. In addition to the case that the PQ symmetry is restored during inflation, there are other viable scenarios, including that the PQ symmetry is broken during inflation at high scales around 10^{16}-10^{17} GeV due to a large Hubble-induced tachyonic scalar mass from the U(1)_A D-term, while the present axion scale is in the range 10^{9}-5times 10^{13} GeV, where the present value larger than 10^{12} GeV requires a fine-tuning of the axion misalignment angle. We also discuss the implications of our results for the size of SUSY breaking soft masses.