No output received (neither expected nor unexpected)

I am trying to run a simple program using Arduino UNO and SIM900A GSM module, which will receive a digit in text message and if the comparison is valid then the pin no. 12 should be high (Led connected on the PIN).

Issue: i see the GSM module getting initialized for receiving, i even see the messages i sent on the serial monitor, but the data sent seems to be unprocessed since there is no change in any pins values, nor anything is printed on the serial monitor.

#include <SoftwareSerial.h>
//use TX to 9 and RX to 10
SoftwareSerial mySerial(9, 10);
  int ledRED = 12;

void setup()
{
  mySerial.begin(9600);   // Setting the baud rate of GSM Module  
  Serial.begin(9600);    // Setting the baud rate of Serial Monitor (Arduino)
  delay(100);
  pinMode(ledRED,OUTPUT);
  ReceiveMessage();
}


void loop()
{
 if (mySerial.available()>0)
   Serial.write(mySerial.read());
  storeData();
   
}

 void ReceiveMessage()
{
  mySerial.println("AT+CNMI=2,2,0,0,0"); // AT Command to receive a live SMS
  delay(1000);
  mySerial.println("GSM SUCCESSFULLY CONFIGURED FOR RECEIVING");
 }
 
 void storeData() 
  {
        while (Serial.available())
     {
         int inNo = Serial.read();
         
        if(inNo=='3')
       {  
         digitalWrite(ledRED,1);    // making Pin 12 high if data received is 'C'
         mySerial.println("RED ON"); // printing the same on the Serial monitor

      }

    }
 }

Can anyone please look at the code and determine what is wrong here and help me fix it.

Thanx in Advance.

Is your GSM modem connected to the software serial (pins 9 & 10) or the hardware serial port?

Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read.

rw950431:
Is your GSM modem connected to the software serial (pins 9 & 10) or the hardware serial port?

yes

Yes to which?

It seems to me your program is confused about which serial port is talking to the GSM module and which one is for human-readable status updates.

For example is Recievemsg you send what appears to be configuration commands to a GSM module on mySerial (the software serial port) but then send a status msg intended for humans to the same port.

void ReceiveMessage()
{
  mySerial.println("AT+CNMI=2,2,0,0,0"); // AT Command to receive a live SMS
  delay(1000);
  mySerial.println("GSM SUCCESSFULLY CONFIGURED FOR RECEIVING");
 }

Whereas in Storedata you read the characters coming in on Serial (the hardware serial port) looking for a '3' (presumably as part of a text message) without having configured a GSM modem on that port.