The %write() function writes the number of bytes designated by size from var to the file specified by file.descriptor returned by a previous call to %open(), %creat(), or %dup().
n= %write(file.descriptor, var, size)
This function returns the number of bytes actually written. If the length of var is less than size, the content of the string written is undefined, as is usual in C. No data translation occurs.
n=len(item) if %write(fd,item,n)<n then crt "write error"