the user a message indicating the shortened name. Use the LENGTH and the
SUBSTR built-in functions as described in z/OS TSO/E REXX Reference.
ANSWER
Possible Solution
/**************************** REXX *********************************/
/* This exec tests the length of a name for a data set member. If */
/* the name is longer than 8 characters, the exec truncates the */
/* extra characters and sends the user a message indicating the */
/* shortened member name. */
/*******************************************************************/
SAY 'Please enter a member name.'
PULL membername
IF LENGTH(membername) > 8 THEN /* Name is longer than 8 characters*/
DO
membername = SUBSTR(membername,1,8) /* Shorten the name to */
/* the first 8 characters*/
SAY 'The member name you entered was too long.'
SAY membername 'will be used.'
END
ELSE NOP
Built-In Functions
Chapter 5. Using Functions 67