STORING AN ARRAY OF INTs IN SD CARD

Hello community, I have the following issue:

I'm trying to sampling and store a voltage signal using the ADC and also the SD card module.
The thing is, firstly I store all the data that comes from the voltage signal in an array of ints (15000 positions) and then I write it in the SD card but when I executed the code, the arduino simply does nothing.

I tried with no array ints, and It worked perfect, but with the array no. I read that with file.write() it is possible to do but just with chars, strings and bytes but no with ints.

here's my code

#include <SD.h>
const int chipSelect=4;
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
void setup() {
  Serial.begin(9600);
  sbi(ADCSRA, ADPS2);
  cbi(ADCSRA, ADPS1);
  cbi(ADCSRA, ADPS0);
  analogReference(DEFAULT);
  pinMode(A0,INPUT);
  if(!SD.begin(chipSelect)){
      Serial.println("Error al leer la tarjeta.");
      return;     
  }
}

void loop() {
 long t0,t;
 File dataFile=SD.open("pruebas.txt" ,FILE_WRITE);
 int a[14999];
 long int pot=0;
   if(dataFile){
    Serial.println("Sampling begins in 3seg");
    delay(3000);
    for(int i=0; i<15000; i++) {
   a[i]=analogRead(A0);

  }

   Serial.println("Writing");
    for(int j=0; j<15000; j++) {
      pot=a[j];
      
      dataFile.println(a[j]);
    
  }
    Serial.println("End of writing.");
     dataFile.close();
     delay(15000);
    
  }
 
  else{
    Serial.println("Error ");
 }
  delay(2000);
}
 byte a[14999];
...
    for(int i=0; i<15000; i++) {
 a[i]=analogRead(A0);

Do you see any problems here?
For instance, what does the thread title SHOUT about datattypes?

Sorry, I didn't change it. I set a like a byte for some tests. Actually it is an Int. I oh ready fixed it in the posted code. Sorry

That's one problem.

What card are you running this on?
Uno has 1K int of SRAM (2048 bytes (2K))
Mega has 4K int (8196 bytes (8K))
1284P has the most, 8K int (16384 bytes (16K))

None will hold 14999 ints, which needs 30000 bytes.
Have you considered adding some external SRAM or FRAM to buffer that burst of data capture?
Or, capture 512 byte bursts (256 ints) and send that to SD card. fat16lib helped me capture mono audio at 41000 16-bit samples here to store to SD card:
http://forum.arduino.cc/index.php?topic=180769.0

Well my friend, lets see, 'cause arduino IDE doesn't warning me about RAM problems

It would have if you'd made the array global.

I think it does - if your code compiles, there will be a message at the end of the compile process saying what percent of global variable space is being used - if it reports 700% used, that would be a problem.

Does your code compile, and do you see such a message?

So this line just needs to be moved to before setup() ?

int a[14999];