If your OPEN failed -- as in giving any file status code other than 00 or 97, then your WRITE would get a 48 file status code.

You should also use the extended file status codes to get the VSAM feedback, return, and reason codes to assist in debugging problems. Of course, they are not needed in this case since the problem is very obvious -- the OPEN failed, you did not check for a good open of the file, then attempted to write to a file not open in I-O or OUTPUT mode.