Multiple choice technology mainframe

What is the result for the command "SUBSTR('MVS',1,5)"

  1. 'MVS'

  2. 'MVS '

  3. ' MVS'

  4. 'MVSSS'

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

In DB2 for z/OS (MVS), if the length specified in the SUBSTR function (5) exceeds the actual length of the string ('MVS', which is 3), the resulting string is padded with single-byte blanks to meet the requested length. This results in 'MVS ' (with two trailing spaces).