Problems interfacing Arduino Uno and Itead GPS shield for GPS datalogger project

Project description:
The project's purpose it to produce a GPS datalogger capturing location and time. This would likely be powered by a 9 volt battery in the field , and use SD cards to retain the data. The sketch will use the SD library for SD card functions, TinyGPS for GPS NMEA message decoding, and SoftwareSerial library for communication between the GPS shield and the Arduino Uno (shield pins 3 and 4). position output should be sent to either (or both) the usb serial port and the SD card whenever either is available.
Hardware:
Arduino Uno R3
Itead Studios GPS shield 1.1 with U-Blox NEO-6m module and active antenna. Also contains SD card module (Chip Select = pin 10)
Software:
Here is my current code. Several debugging "Serial.print" statements have been commented out.

#include <SD.h>                                 //copyright 2010 Sparkfun Electronics
#include <SoftwareSerial.h>
#include <TinyGPS.h>
TinyGPS GPS;

SoftwareSerial ss(3,4);
const int chipSelect = 10;
void setup()
{

  Serial.begin(4800);                      // begin comm arduino <->PC
  ss.begin(38400);                        // begin comm GSP<->arduino
  //
  // THE FOLLOWING COMMAND SWITCHES MODULE TO 4800 BAUD
  // THEN SWITCHES THE SOFTWARE SERIAL TO 4,800 BAUD
  //
  ss.print("$PUBX,41,1,0007,0003,4800,0*13\r\n"); 
  // command 41 (set protocol and baud), com port ID,input protocol mask,output protocol mask,baudrate,autobauding enable=1,*checksum,return,newline
  ss.begin(4800);
  ss.flush();
  // open SD card and datafile
  pinMode(chipSelect, OUTPUT);                                               // set chip select pin to output mode
  if (!SD.begin(chipSelect)) 
  {
   // Serial.println("SD card failed");
    return;
  }
  //Serial.println("SD card OK");
}

void loop()
{
                    
while(ss.available())                                                    // while the GPS soft serial port is open
  {
  int c = ss.read();
  if (GPS.encode(c))
     {  
     // Serial.println("Got GPS data");
      
      long lat, lon;
      unsigned long fix_age, time, date;
      GPS.get_position (&lat,&lon,&fix_age);     
      GPS.get_datetime(&date,&time,&fix_age);
      
      File dataFile = SD.open("datalog.txt", FILE_WRITE);   //open datalog file on SD card
      if(dataFile)                                                             // if datafile is available, write to it
         {                                                                     // otherwise just write to pc terminal
      //   Serial.println("SD data file opened ok");
         dataFile.print(lat);
         dataFile.print(", ");
         dataFile.print(lon);
         dataFile.print(", ");
         dataFile.print (date);
         dataFile.print(", ");
         dataFile.println(time);
         }
      Serial.print(lat);
      Serial.print(", ");
      Serial.print(lon);
      Serial.print(", ");
      Serial.print (date);
      Serial.print(", ");
      Serial.print(time);
      Serial.print(" ,");
      Serial.println(fix_age);
      dataFile.close();
     // Serial.println("closed data file");
      }   
   }
}

Problems:

(1) The default bit rate of the u-blox GPS module on the Itead GPS shield appears to be 38,400 bps. Since I am using the SoftSerial library which apparently has a top speed of 19,200 bps before dropping bits, I have had to find a way to "throttle back" the module to a much slower speed, or I never get a complete NMEA sentence. So the first part of the setup() code above including the $PUBX command to the u-blox module set the speed to 48bps. This is not retained by the shield as the default setting, and this code must be executed after each powerup sequence to re-install the slower bps rate. In addition, I have tried to use the u-center software provided by u-blox with a simple two way read-write sketch on the Arduino. This will allow me to see the GPS output (position, satellites, etc), but the software "switches" to set the GPS default bps using u-center don't seem to work. It always defaults back to 38,400 on powerup. While the sequence in setup() above has worked fine elsewhere, it appears that it isn't working on powerup in this sketch. Pulling the USB plug and re-inserting it produces a blank monitor screen, suggesting the GPS module has reverted to 38,400 bps.
I borrowed the setup code above from a sketch found on the net. Any code which could set the GPS shield default rate to 4800 bps would be welcome!

(2) In the main loop, I intend that if the log file on the SD card is available, then write the location and time data to the card and also to the USB monitor. If the card isn't available, then send output only to the USB monitor for debugging purposes. However, it seems that if the USB monitor (serial port 2 in my case) isn't available (when powered by 9V battery), then the sketch simply locks up - no output to SC card even though the card is OK. Of course, it's hard to debug when you have no screen output available. Is it normal for sketches to lock up when they encounter a "serial.print" line, and if so, how can I test for the availability of a serial port and jump around the "serial.print" statements.

In general, this project works nicely except for the problems described.

hello, thank you! I have a problem with the time, I get one that is not correct.
as I can do to come out eg HH: SS: MM -> Hour: Minute: Seconds

parameters obtained
-27227540, -61189734, 290114 * 12303200 * 63