REVERSE: PROC(IN_STRING) RETURNS(CHAR(*) VARYING); /* PROCEDURE REVERSES THE ORDER OF CHARACTERS IN IN_STRING AND RETURNS REVERSED STRING AUTHOR: AL JAWORSKI DATE: MARCH 1, 1982 */ DCL IN_STRING CHAR(*) VARYING; DCL OUT_STRING CHAR(LENGTH(IN_STRING)) BASED(P); DCL P POINTER; DCL I FIXED BINARY(31); ALLOC OUT_STRING SET(P); OUT_STRING=IN_STRING; DO I=1 TO LENGTH(IN_STRING); SUBSTR(OUT_STRING,I,1)=SUBSTR(IN_STRING,LENGTH(OUT_STRING)-I+1); END; RETURN(OUT_STRING); END REVERSE;