diff --git a/obj/Makefile.in b/obj/Makefile.in
index 7fec2b6655176e802dc4b7aff866667336dc6c0f..99cc7a0f69b8e3cb0b7591afba6c601b273dcdd3 100644
--- a/obj/Makefile.in
+++ b/obj/Makefile.in
@@ -85,7 +85,7 @@ include ../src/xercesc/Makefile.incl
 LIB=${XERCESCROOT}/lib
 ## OS390BATCH
 ifeq (${OS390BATCH},1)
-BATCH_TARGET = "//'${LOADMOD}(IXM4C40)'"
+BATCH_TARGET = "//'${LOADMOD}(IXM4C50)'"
 endif
 ifneq (${PLATFORM}, OS400)
 LIBNAME=libxerces-c
diff --git a/samples/Makefile.incl b/samples/Makefile.incl
index 96d8ca043c3ff65ed1e00f03f2a8d73a4b078ee0..3116c993d58e651745dd0f6fceaf8fa235bc4c23 100644
--- a/samples/Makefile.incl
+++ b/samples/Makefile.incl
@@ -247,7 +247,7 @@ endif
 #   export LOADMOD=USERID.LOAD                                    #
 #   export LOADEXP=SYS1.SIXMEXP or &hlq.SIXMEXP                   #
 #                                                                 #
-# to specify your LOADMOD and the IXM4C40X definition sidedeck    #
+# to specify your LOADMOD and the IXM4C50X definition sidedeck    #
 # dataset.  													  #
 ###################################################################
 
@@ -266,7 +266,7 @@ SHLIBSUFFIX=.dll
 OS390SIDEDECK=.x
 ## OS390BATCH
 ifeq (${OS390BATCH},1)
-LIBRARY_NAMES="//'${LOADEXP}(IXM4C40X)'"
+LIBRARY_NAMES="//'${LOADEXP}(IXM4C50X)'"
 else
 LIBRARY_NAMES=${LIB_DIR}/lib${LIBNAME}${VER}${OS390SIDEDECK}
 endif
diff --git a/src/xercesc/Makefile.incl b/src/xercesc/Makefile.incl
index 510fd2623ceb6bcca7afed7223772216d0f1b3a3..8905a9dfd5adaa7ad3ebd8a42d6bdc89fce7500b 100644
--- a/src/xercesc/Makefile.incl
+++ b/src/xercesc/Makefile.incl
@@ -407,9 +407,9 @@ MAKE_SHARED_C = ${PLATFORM_C_COMPILER} -D${PLATFORM} -W l,dll ${LDFLAGS}
 ifeq (${TRANSCODER}, ICU)
 ## OS390BATCH
     ifeq (${OS390BATCH},1)
-	ALLLIBS = "//'${LOADEXP}(IXM20UCX)'"
+	ALLLIBS = "//'${LOADEXP}(IXM22UCX)'"
     else
-	ALLLIBS = ${ICUROOT}/lib/libicuuc.20.2.x
+	ALLLIBS = ${ICUROOT}/lib/libicuuc22.0.x
     endif
 else
 	ALLLIBS =
@@ -476,18 +476,28 @@ ifeq (${PLATFORM}, AIX)
     REAL_NAME=${LIBNAME}${SO_TARGET_VERSION}.${SO_TARGET_VERSION_MAJOR}${SHLIBSUFFIX}
 
 else
-
-    #
-    # LINK_NAME=libxerces-c.so
-    # SO_NAME  =libxerces-c.so.20
-    # REAL_NAME=libxerces-c.so.20.0
-    #
-    LINK_NAME=${LIBNAME}${SHLIBSUFFIX}
-    SO_NAME  =${LIBNAME}${SHLIBSUFFIX}.${SO_TARGET_VERSION}
-    REAL_NAME=${LIBNAME}${SHLIBSUFFIX}.${SO_TARGET_VERSION}.${SO_TARGET_VERSION_MAJOR}
-
+    ifeq (${PLATFORM}, OS390)
+        #
+        # LINK_NAME=libxerces-c.dll
+        # SO_NAME  =libxerces-c20.dll
+        # REAL_NAME=libxerces-c2_0_0.dll
+        #
+        LINK_NAME=${LIBNAME}${SHLIBSUFFIX}
+        SO_NAME  =${LIBNAME}${SO_TARGET_VERSION}${SHLIBSUFFIX}
+        REAL_NAME=${LIBNAME}${VER}${SHLIBSUFFIX}
+    else
+        #
+        # LINK_NAME=libxerces-c.so
+        # SO_NAME  =libxerces-c.so.20
+        # REAL_NAME=libxerces-c.so.20.0
+        #
+        LINK_NAME=${LIBNAME}${SHLIBSUFFIX}
+        SO_NAME  =${LIBNAME}${SHLIBSUFFIX}.${SO_TARGET_VERSION}
+        REAL_NAME=${LIBNAME}${SHLIBSUFFIX}.${SO_TARGET_VERSION}.${SO_TARGET_VERSION_MAJOR}
+    endif
 endif
 
+
 FQ_LINK_NAME=${XML_LIB_DIR}/${LINK_NAME}
 FQ_SO_NAME  =${XML_LIB_DIR}/${SO_NAME}
 FQ_REAL_NAME=${XML_LIB_DIR}/${REAL_NAME}
diff --git a/src/xercesc/util/Compilers/MVSCPPDefs.hpp b/src/xercesc/util/Compilers/MVSCPPDefs.hpp
index 6941a7e098b0ebe6cef844950108a5038d794c47..0f927bbb600e573d8ab42a09fff980c5355e2c69 100644
--- a/src/xercesc/util/Compilers/MVSCPPDefs.hpp
+++ b/src/xercesc/util/Compilers/MVSCPPDefs.hpp
@@ -56,6 +56,9 @@
 
 /*
  * $Log$
+ * Revision 1.5  2002/08/08 16:40:16  tng
+ * 390 Changes from Stephen Dulin.
+ *
  * Revision 1.4  2002/05/28 12:57:17  tng
  * Fix typo.
  *
@@ -131,7 +134,7 @@
 //  Indicate that we do not support native bools
 //  If the compiler can handle boolean itself, do not define it
 // ---------------------------------------------------------------------------
-#define NO_NATIVE_BOOL
+//#define NO_NATIVE_BOOL
 
 
 // ---------------------------------------------------------------------------
diff --git a/src/xercesc/util/Platforms/OS390/OS390PlatformUtils.cpp b/src/xercesc/util/Platforms/OS390/OS390PlatformUtils.cpp
index 21a9f50dbe235a1efe77dc51b5aef93604928041..f3121223c8ea1ca180c072dd5882363ac72f8931 100644
--- a/src/xercesc/util/Platforms/OS390/OS390PlatformUtils.cpp
+++ b/src/xercesc/util/Platforms/OS390/OS390PlatformUtils.cpp
@@ -381,7 +381,7 @@ FileHandle XMLPlatformUtils::openFile(const char* const fileName)
     // Find the last '/' in the path - this seperates the path from the
     // filename.  Then copy the pathname.
 
-    char* pathEnd = strrchr( tmpPos, '/' );
+    char* pathEnd = strrchr((char*) tmpPos, '/' );
     if( pathEnd == NULL ) pathEnd = tmpPos - 1;
     while( tmpPos <= pathEnd ) {
         switch( *tmpPos ) {
@@ -396,7 +396,7 @@ FileHandle XMLPlatformUtils::openFile(const char* const fileName)
 
     // Now we try to locate the extension, and copy that.
 
-    char* extStart = strrchr( fileName, '.' );
+    char* extStart = strrchr((char*) fileName, '.' );
     if ( extStart != NULL ) {
         tmpPos = extStart + 1;
         while( *tmpPos != '\0' ) {
@@ -438,6 +438,157 @@ FileHandle XMLPlatformUtils::openFile(const char* const fileName)
     return retVal;
 }
 
+FileHandle XMLPlatformUtils::openFileToWrite(const XMLCh* const fileName)
+{
+    const char* tmpFileName = XMLString::transcode(fileName);
+    ArrayJanitor<char> janText((char*)tmpFileName);
+    char* semicolon;
+    char* optStart;
+    int   optOffset = 0;
+    int   dsnSize = 0;
+    int   optSize = 0;
+
+    // Check if this is an MVS dataset. If it is we need to allow
+    // DCB options to be passed in the URI we get. The options
+    // will be after the ";" in the URI in this case.
+    if ((tmpFileName[0] == '/') && (tmpFileName[1] == '/'))
+    {
+       semicolon = strrchr((char*)tmpFileName,';');
+       if (semicolon == NULL)
+          dsnSize = strlen(tmpFileName);
+       else
+       {
+          dsnSize = semicolon - tmpFileName;
+          optStart = semicolon;
+          optStart++;
+          optOffset = optStart - tmpFileName;
+          optSize = (strlen(tmpFileName) - optOffset);
+        }
+
+        // Make a copy of the dataset name to pass to fopen
+        char* dsnbuf = new char[dsnSize + 1];
+        ArrayJanitor<char> janText1((char*)dsnbuf);
+        strncpy(dsnbuf, tmpFileName, dsnSize);
+
+        // If no options specified, then we just put a "wb" in there.
+        // Otherwise we put a "wb" followed by a comma followed by
+        // the options string.
+        if (optSize == 0)
+           optSize += 3;
+        else
+           optSize += 4;
+
+        // Save the options for fopen
+        char* optbuf = new char[optSize];
+        ArrayJanitor<char> janText2((char*)optbuf);
+        strcpy(optbuf, "wb");
+
+        if (optSize != 3)
+        {
+           strcpy(optbuf + 2, ",");
+           strncpy(optbuf +3, optStart, optSize);
+        }
+
+        return fopen(dsnbuf, optbuf);
+
+    }
+    else
+       return fopen(tmpFileName, "wb");
+
+}
+
+FileHandle XMLPlatformUtils::openFileToWrite(const char* const fileName)
+{
+    char* semicolon;
+    char* optStart;
+    int   optOffset = 0;
+    int   dsnSize = 0;
+    int   optSize = 0;
+
+    // Check if this is an MVS dataset. If it is we need to allow
+    // DCB options to be passed in the URI we get. The options
+    // will be after the ";" in the URI in this case.
+    if ((fileName[0] == '/') && (fileName[1] == '/'))
+    {
+       semicolon = strrchr((char*)fileName,';');
+       if (semicolon == NULL)
+          dsnSize = strlen(fileName);
+       else
+       {
+          dsnSize = semicolon - fileName;
+          optStart = semicolon;
+          optStart++;
+          optOffset = optStart - fileName;
+          optSize = (strlen(fileName) - optOffset);
+        }
+
+        // Make a copy of the dataset name to pass to fopen
+        char* dsnbuf = new char[dsnSize + 1];
+        ArrayJanitor<char> janText1((char*)dsnbuf);
+        strncpy(dsnbuf, fileName, dsnSize);
+
+        // If no options specified, then we just put a "wb" in there.
+        // Otherwise we put a "wb" followed by a comma followed by
+        // the options string.
+        if (optSize == 0)
+           optSize += 3;
+        else
+           optSize += 4;
+
+        // Save the options for fopen
+        char* optbuf = new char[optSize];
+        ArrayJanitor<char> janText2((char*)optbuf);
+        strcpy(optbuf, "wb");
+
+        if (optSize != 3)
+        {
+           strcpy(optbuf + 2, ",");
+           strncpy(optbuf +3, optStart, optSize);
+        }
+
+        return fopen(dsnbuf, optbuf);
+
+    }
+    else
+       return fopen(fileName, "wb");
+
+}
+
+void
+XMLPlatformUtils::writeBufferToFile( FileHandle     const  theFile
+                                   , long                  toWrite
+                                   , const XMLByte* const  toFlush)
+{
+    if (!theFile        ||
+        (toWrite <= 0 ) ||
+        !toFlush         )
+        return;
+
+    const XMLByte* tmpFlush = (const XMLByte*) toFlush;
+    size_t bytesWritten = 0;
+
+    while (true)
+    {
+        bytesWritten=fwrite(tmpFlush, sizeof(XMLByte), toWrite, (FILE*)theFile);
+
+        if(ferror((FILE*)theFile))
+        {
+            ThrowXML(XMLPlatformUtilsException, XMLExcepts::File_CouldNotWriteToFile);
+        }
+
+        if (bytesWritten < toWrite) //incomplete write
+        {
+            tmpFlush+=bytesWritten;
+            toWrite-=bytesWritten;
+            bytesWritten=0;
+        }
+        else
+            return;
+    }
+
+    return;
+}
+
 unsigned int
 XMLPlatformUtils::readFileBuffer(  FileHandle      theFile
                                 , const unsigned int    toRead
@@ -476,6 +627,10 @@ XMLCh* XMLPlatformUtils::getFullPath(const XMLCh* const srcPath)
     char* newSrc = XMLString::transcode(srcPath);
     ArrayJanitor<char> janText(newSrc);
 
+    if ( (newSrc != NULL) && (newSrc[0] != NULL) && (newSrc[1] != NULL) && //@DEM
+         (newSrc[0] == '/') && (newSrc[1] == '/') )       //@DEM
+        return XMLString::transcode(newSrc);              //@DEM
+
     // Use a local buffer that is big enough for the largest legal path
     char *absPath = new char[_POSIX_PATH_MAX];
     ArrayJanitor<char> janText2(absPath);
diff --git a/tests/Makefile.incl b/tests/Makefile.incl
index bd7bb826ffcf5780d0cda5cfee5c1fd4d662dae6..295835f1337eb399eb9101af4da6b7368ee870da 100644
--- a/tests/Makefile.incl
+++ b/tests/Makefile.incl
@@ -246,7 +246,7 @@ endif
 #   export LOADMOD=USERID.LOAD                                    #
 #   export LOADEXP=SYS1.SIXMEXP or &hlq.SIXMEXP                   #
 #                                                                 #
-# to specify your LOADMOD and the IXM4C40X definition sidedeck    #
+# to specify your LOADMOD and the IXM4C50X definition sidedeck    #
 # dataset.  													  #
 ###################################################################
 
@@ -265,7 +265,7 @@ SHLIBSUFFIX=.dll
 OS390SIDEDECK=.x
 ## OS390BATCH
 ifeq (${OS390BATCH},1)
-LIBRARY_NAMES="//'${LOADEXP}(IXM4C40X)'"
+LIBRARY_NAMES="//'${LOADEXP}(IXM4C50X)'"
 else
 LIBRARY_NAMES=${LIB_DIR}/lib${LIBNAME}${VER}${OS390SIDEDECK}
 endif