Character buffers

To match the convention for passing strings in MVS, the RAM should expect all character buffers passed to it to be padded with spaces instead of being null-terminated. The RAM should also set up any buffers being returned to the client in the same way. Assuming a buffer length of 30, the string " CARMA mechanic" would be passed in the format illustrated in Figure 1 instead of the format illustrated in Figure 2 (where ? represents an unknown character). Both RAM and client developers should initialize buffers that they have created to be filled with spaces.

Figure 1. Example of correct RAM buffer usage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
C A R M A   m e c h a n i c                                
Figure 2. Example of incorrect RAM buffer usage
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
C A R M A   m e c h a n i c \0 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?

An improvement to CARMA in version 7.1 is the ability for the CARMA client to support null terminated character buffers (as shown in figure 6). All strings passed to the RAM will still be in the format shown in Figure 5, but the provided CARMA client will work with both space filled and null terminated character buffers. Before designing your RAM to provide null terminated character buffers, ensure it will only be used with version 7.1 or later of CARMA clients, or another appropriate client.